


def 						__SCREAMING_SNAKE_CASE       (					lowercase_			)		->    str:




						'''simple docstring'''







						__UpperCAmelCase :       str  						=  ''''''
						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 						__SCREAMING_SNAKE_CASE       (					lowercase_			)		->    dict[str, str]:




						'''simple docstring'''







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




def 						__SCREAMING_SNAKE_CASE       (					lowercase_			,					lowercase_			)		->    str:




						'''simple docstring'''







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




def 						__SCREAMING_SNAKE_CASE       (					lowercase_			,					lowercase_			)		->    str:




						'''simple docstring'''







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




def 						__SCREAMING_SNAKE_CASE       (					)		->    None:




						'''simple docstring'''







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


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				main()





def 						__SCREAMING_SNAKE_CASE       (					lowercase_			,					lowercase_			)		->    str:




						'''simple docstring'''







						if a < 0 or b < 0:
												raise ValueError('''the value of both inputs must be positive'''			)
						__UpperCAmelCase :       Dict  						=  str(bin(lowercase_			)			)[2:]  # remove the leading "0b"
						__UpperCAmelCase :       List[Any]  						=  str(bin(lowercase_			)			)[2:]
						__UpperCAmelCase :       List[Any]  						=  max(len(lowercase_			)			,					len(lowercase_			)			)
						return "0b" + "".join(
						    str(int('''1''' in (char_a, char_b)			)			)
						    for char_a, char_b in zip(a_binary.zfill(lowercase_			)			,					b_binary.zfill(lowercase_			)			)			)


if __name__ == "__main__":
				import doctest

				doctest.testmod()

