





'''simple docstring'''

lowercase_			       =				{
    """A""": ("""ABCDEFGHIJKLM""", """NOPQRSTUVWXYZ"""),
    """B""": ("""ABCDEFGHIJKLM""", """NOPQRSTUVWXYZ"""),
    """C""": ("""ABCDEFGHIJKLM""", """ZNOPQRSTUVWXY"""),
    """D""": ("""ABCDEFGHIJKLM""", """ZNOPQRSTUVWXY"""),
    """E""": ("""ABCDEFGHIJKLM""", """YZNOPQRSTUVWX"""),
    """F""": ("""ABCDEFGHIJKLM""", """YZNOPQRSTUVWX"""),
    """G""": ("""ABCDEFGHIJKLM""", """XYZNOPQRSTUVW"""),
    """H""": ("""ABCDEFGHIJKLM""", """XYZNOPQRSTUVW"""),
    """I""": ("""ABCDEFGHIJKLM""", """WXYZNOPQRSTUV"""),
    """J""": ("""ABCDEFGHIJKLM""", """WXYZNOPQRSTUV"""),
    """K""": ("""ABCDEFGHIJKLM""", """VWXYZNOPQRSTU"""),
    """L""": ("""ABCDEFGHIJKLM""", """VWXYZNOPQRSTU"""),
    """M""": ("""ABCDEFGHIJKLM""", """UVWXYZNOPQRST"""),
    """N""": ("""ABCDEFGHIJKLM""", """UVWXYZNOPQRST"""),
    """O""": ("""ABCDEFGHIJKLM""", """TUVWXYZNOPQRS"""),
    """P""": ("""ABCDEFGHIJKLM""", """TUVWXYZNOPQRS"""),
    """Q""": ("""ABCDEFGHIJKLM""", """STUVWXYZNOPQR"""),
    """R""": ("""ABCDEFGHIJKLM""", """STUVWXYZNOPQR"""),
    """S""": ("""ABCDEFGHIJKLM""", """RSTUVWXYZNOPQ"""),
    """T""": ("""ABCDEFGHIJKLM""", """RSTUVWXYZNOPQ"""),
    """U""": ("""ABCDEFGHIJKLM""", """QRSTUVWXYZNOP"""),
    """V""": ("""ABCDEFGHIJKLM""", """QRSTUVWXYZNOP"""),
    """W""": ("""ABCDEFGHIJKLM""", """PQRSTUVWXYZNO"""),
    """X""": ("""ABCDEFGHIJKLM""", """PQRSTUVWXYZNO"""),
    """Y""": ("""ABCDEFGHIJKLM""", """OPQRSTUVWXYZN"""),
    """Z""": ("""ABCDEFGHIJKLM""", """OPQRSTUVWXYZN"""),
}





def lowerCamelCase		(  __lowerCamelCase				:					str					)		->list[tuple[str, str]]:
				return [alphabet[char] for char in key.upper()]





def lowerCamelCase		(  __lowerCamelCase				:					str      , __lowerCamelCase				:					str					)		->str:
				_SCREAMING_SNAKE_CASE             =    """"""
				_SCREAMING_SNAKE_CASE             =    0
				_SCREAMING_SNAKE_CASE             =    generate_table(__lowerCamelCase					)
				for char in words.upper():
								cipher += get_opponent(table[count]      , __lowerCamelCase					)
								_SCREAMING_SNAKE_CASE             =    (count + 1) % len(__lowerCamelCase					)
				return cipher





def lowerCamelCase		(  __lowerCamelCase				:					str      , __lowerCamelCase				:					str					)		->str:
				return encrypt(__lowerCamelCase      , __lowerCamelCase					)





def lowerCamelCase		(  __lowerCamelCase				:					tuple[str, str]      , __lowerCamelCase				:					str					)		->tuple[int, int]:
				_SCREAMING_SNAKE_CASE             =    0 if char in table[0] else 1
				_SCREAMING_SNAKE_CASE             =    table[row].index(__lowerCamelCase					)
				return row, col





def lowerCamelCase		(  __lowerCamelCase				:					tuple[str, str]      , __lowerCamelCase				:					str					)		->str:
				_SCREAMING_SNAKE_CASE       , _SCREAMING_SNAKE_CASE             =    get_position(__lowerCamelCase      , char.upper()					)
				if row == 1:
								return table[0][col]
				else:
								return table[1][col] if row == 0 else char


if __name__ == "__main__":
						import doctest

						doctest.testmod()  # Fist ensure that all our tests are passing...
						lowercase_			       =				input("""Enter key: """).strip()
						lowercase_			       =				input("""Enter text to encrypt: """).strip()
						lowercase_			       =				encrypt(key, text)

						print(f"""Encrypted: {cipher_text}""")
						print(f"""Decrypted with key: {decrypt(key, cipher_text)}""")










'''simple docstring'''

def lowerCamelCase		(  __lowerCamelCase				:					str					)		->str:
    _SCREAMING_SNAKE_CASE             =    word.upper()
    _SCREAMING_SNAKE_CASE             =    0
    _SCREAMING_SNAKE_CASE             =    {}
    _SCREAMING_SNAKE_CASE             =    []

    for letter in word:
        if letter not in letter_nums:
            _SCREAMING_SNAKE_CASE             =    str(__lowerCamelCase					)
            next_num += 1
        word_pattern.append(letter_nums[letter]					)
    return ".".join(__lowerCamelCase					)


if __name__ == "__main__":
      import pprint
      import time

      lowercase_			       =				time.time()
      with open("""dictionary.txt""") as in_file:
            lowercase_			       =				in_file.read().splitlines()

      lowercase_			       =				{}
      for word in word_list:
            lowercase_			       =				get_word_pattern(word)
            if pattern in all_patterns:
                  all_patterns[pattern].append(word)
            else:
                  lowercase_			       =				[word]

      with open("""word_patterns.txt""", """w""") as out_file:
            out_file.write(pprint.pformat(all_patterns))

      lowercase_			       =				round(time.time() - start_time, 2)
      print(f"""Done!  {len(all_patterns):,} word patterns found in {total_time} seconds.""")
      # Done!  9,581 word patterns found in 0.58 seconds.



