


def 	__lowerCAmelCase   (SCREAMING_SNAKE_CASE )->  str:




      """simple docstring"""

      snake_case_	=				''''''
      for ch in key:
            if ch == " " or ch not in key_no_dups and ch.isalpha():
                  key_no_dups += ch
      return key_no_dups






def 	__lowerCAmelCase   (SCREAMING_SNAKE_CASE )->  dict[str, str]:




      """simple docstring"""

      snake_case_	=				[chr(i + 65 ) for i in range(26 )]
      # Remove duplicate characters from key
      snake_case_	=				remove_duplicates(key.upper() )
      snake_case_	=				len(SCREAMING_SNAKE_CASE )
      # First fill cipher with key characters
      snake_case_	=				{alphabet[i]: char for i, char in enumerate(SCREAMING_SNAKE_CASE )}
      # Then map remaining characters in alphabet to
      # the alphabet from the beginning
      for i in range(len(SCREAMING_SNAKE_CASE ) , 26 ):
            snake_case_	=				alphabet[i - offset]
            # Ensure we are not mapping letters to letters previously mapped
            while char in key:
                  offset -= 1
                  snake_case_	=				alphabet[i - offset]
            snake_case_	=				char
      return cipher_alphabet






def 	__lowerCAmelCase   (SCREAMING_SNAKE_CASE , SCREAMING_SNAKE_CASE )->  str:




      """simple docstring"""

      return "".join(cipher_map.get(SCREAMING_SNAKE_CASE , SCREAMING_SNAKE_CASE ) for ch in message.upper() )






def 	__lowerCAmelCase   (SCREAMING_SNAKE_CASE , SCREAMING_SNAKE_CASE )->  str:




      """simple docstring"""

      snake_case_	=				{v: k for k, v in cipher_map.items()}
      return "".join(rev_cipher_map.get(SCREAMING_SNAKE_CASE , SCREAMING_SNAKE_CASE ) for ch in message.upper() )






def 	__lowerCAmelCase   ()->  None:




      """simple docstring"""

      snake_case_	=				input('''Enter message to encode or decode: ''' ).strip()
      snake_case_	=				input('''Enter keyword: ''' ).strip()
      snake_case_	=				input('''Encipher or decipher? E/D:''' ).strip()[0].lower()
      try:
            snake_case_	=				{'''e''': encipher, '''d''': decipher}[option]
      except KeyError:
            raise KeyError('''invalid input option''' )
      snake_case_	=				create_cipher_map(SCREAMING_SNAKE_CASE )
      print(func(SCREAMING_SNAKE_CASE , SCREAMING_SNAKE_CASE ) )


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   main()



def 	__lowerCAmelCase   (SCREAMING_SNAKE_CASE )->  int:




      """simple docstring"""

      if not isinstance(SCREAMING_SNAKE_CASE , SCREAMING_SNAKE_CASE ):
            snake_case_	=				f'''Input value of [number={number}] must be an integer'''
            raise TypeError(SCREAMING_SNAKE_CASE )

      if number < 1:
            snake_case_	=				f'''Input value of [number={number}] must be > 0'''
            raise ValueError(SCREAMING_SNAKE_CASE )

      snake_case_	=				1

      for i in range(1 , SCREAMING_SNAKE_CASE ):
            current_number *= 4 * i - 2
            current_number //= i + 1

      return current_number


if __name__ == "__main__":
   import doctest

   doctest.testmod()