human
I found an interesting problem on https://www.codewars.com/kata/52d1bd3694d26f8d6e0000d3:
The Vigenère cipher is a classic cipher originally developed by Italian cryptographer Giovan Battista Bellaso and published in 1553. It is named after a later French cryptographer Blaise de Vigenère, who had developed a stronger autokey cipher (a cipher that incorporates the message of the text into the key). 

The cipher is easy to understand and implement, but survived three centuries of attempts to break it, earning it the nickname "le chiffre indéchiffrable" or "the indecipherable cipher."

[From Wikipedia](https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher):

> The Vigenère cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword. It is a simple form of polyalphabetic substitution.
>
> . . .
>
> In a Caesar cipher, each letter of the alphabet is shifted along some number of places.
for example, in a Caesar cipher of shift `3`, `A` would become `D`, `B` would become `E`, `Y` would become `B` and so on. The Vigenère cipher consists of several Caesar ciphers in sequence with different shift values.

Assume the key is repeated for the length of the text, character by character. Note that some implementations repeat the key over characters only if they are part of the alphabet -- **this is not the case here.**

The shift is derived by applying a Caesar shift to a character with the corresponding index of the key in the alphabet.

Visual representation:
Write a class that, when given a key and an alphabet, can be used to encode and decode from the cipher.

## Example
Any character not in the alphabet must be left as is. For example (following from above):

I tried it in Python, but could not do it. Can you solve it?

 ... Write me a the Python program you requested?
assistant
#Here is the Python program you requested.

class VigenereCipher(object):
    cipherMap = {}
    invCipherMap = {}
    alphabet = ''
    lenAlphabet = -1
    key = ''
    lenKey = -1

    def __init__(self, key, alphabet):
        self.key = key
        self.lenKey = len(self.key)
        self.alphabet = alphabet
        self.lenAlphabet = len(self.alphabet)
        self.cipherMap = dict(list(enumerate(self.alphabet)))    #slick way learned @ stackExchange :)    
        self.invCipherMap = {val: key for key, val in list(self.cipherMap.items())}   #invert the cipher map
    #-----end constructor


    #helper function to perform the cipher. Note, if a char (in the provided text) is not
    # in the provided alphabet, we are to leave it be; otherwise, based on the alphabet 
    # and the key, we are to encode the character using the Vigenere Cipher    
    def __performVigenereCipher__(self, text, performEncode):
        lenText = len(text)
        encodedText = ''

        for i in range(lenText):
            curChar = text[i]
            keyChar = self.key[i%self.lenKey]

            if curChar in self.alphabet:        #Scenario: Perform Vigenere Cipher
                charVal = self.invCipherMap[curChar]
                keyVal  = self.invCipherMap[keyChar]

                if performEncode:
                    valEncoded = (charVal + keyVal)%self.lenAlphabet
                else:
                    valEncoded = (charVal - keyVal)%self.lenAlphabet

                encodedChar = self.cipherMap[valEncoded] 
            else:   #Scienario: The char is not in the alphabet; leave it be
                encodedChar = curChar
            
            encodedText += encodedChar
        #---end for loop

        return encodedText
    #-----end function

    def encode(self, text):
        performEncode = True
        encodedText = self.__performVigenereCipher__(text, performEncode)        
        return encodedText
    #-----end function encode    
    
    def decode(self, text):
        performEncode = False
        decodedText =...