



"""simple docstring"""




def 					__snake_case     (      _UpperCAmelCase    ):
    __a							=    ''''''
    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 					__snake_case     (      _UpperCAmelCase    ):
    __a							=    [chr(i + 65    ) for i in range(26    )]
    # Remove duplicate characters from key
    __a							=    remove_duplicates(key.upper()    )
    __a							=    len(_UpperCAmelCase    )
    # First fill cipher with key characters
    __a							=    {alphabet[i]: char for i, char in enumerate(_UpperCAmelCase    )}
    # Then map remaining characters in alphabet to
    # the alphabet from the beginning
    for i in range(len(_UpperCAmelCase    )       ,			26    ):
        __a							=    alphabet[i - offset]
        # Ensure we are not mapping letters to letters previously mapped
        while char in key:
            offset -= 1
            __a							=    alphabet[i - offset]
        __a							=    char
    return cipher_alphabet





def 					__snake_case     (      _UpperCAmelCase       ,			_UpperCAmelCase    ):
    return "".join(cipher_map.get(_UpperCAmelCase       ,			_UpperCAmelCase    ) for ch in message.upper()    )





def 					__snake_case     (      _UpperCAmelCase       ,			_UpperCAmelCase    ):
    __a							=    {v: k for k, v in cipher_map.items()}
    return "".join(rev_cipher_map.get(_UpperCAmelCase       ,			_UpperCAmelCase    ) for ch in message.upper()    )





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


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 main()










import unittest

from transformers import DonutProcessor


__snake_case						:List[str]						=					'''naver-clova-ix/donut-base'''

class    _A	(     unittest.TestCase   ):



       def 		_lowerCamelCase      (		self							:					List[str]):


           '''simple docstring'''

           __a							=    DonutProcessor.from_pretrained(__SCREAMING_SNAKE_CASE)





       def 		_lowerCamelCase      (		self							:					Tuple):


           '''simple docstring'''

           __a							=    {
               '''name''': '''John Doe''',
               '''age''': '''99''',
               '''city''': '''Atlanta''',
               '''state''': '''GA''',
               '''zip''': '''30301''',
               '''phone''': '''123-4567''',
               '''nicknames''': [{'''nickname''': '''Johnny'''}, {'''nickname''': '''JD'''}],
           }

           __a							=    (
               '''<s_name>John Doe</s_name><s_age>99</s_age><s_city>Atlanta</s_city>'''
               '''<s_state>GA</s_state><s_zip>30301</s_zip><s_phone>123-4567</s_phone>'''
               '''<s_nicknames><s_nickname>Johnny</s_nickname>'''
               '''<sep/><s_nickname>JD</s_nickname></s_nicknames>'''
           )
           __a							=    self.processor.tokenajson(__SCREAMING_SNAKE_CASE)

           self.assertDictEqual(__SCREAMING_SNAKE_CASE					,		__SCREAMING_SNAKE_CASE)





