


from typing import Literal

a					:				str       =      'ABCDEFGHIJKLMNOPQRSTUVWXYZ'






def  _UpperCAmelCase						( __lowerCamelCase			,  __lowerCamelCase			,  __lowerCamelCase							)		->str:


 '''simple docstring'''
 snake_case :			Tuple							=   LETTERS if mode == '''decrypt''' else key
 snake_case :			Tuple							=   key if mode == '''decrypt''' else LETTERS
 snake_case :			Any							=   ''''''
 # loop through each symbol in the message
 for symbol in message:
  if symbol.upper() in chars_a:
   # encrypt/decrypt the symbol
   snake_case :			List[str]							=   chars_a.find(symbol.upper()							)
   if symbol.isupper():
    translated += chars_b[sym_index].upper()
   else:
    translated += chars_b[sym_index].lower()
  else:
   # symbol is not in LETTERS, just add it
   translated += symbol
 return translated






def  _UpperCAmelCase						( __lowerCamelCase			,  __lowerCamelCase							)		->str:


 '''simple docstring'''
 return translate_message(__lowerCamelCase			,  __lowerCamelCase			,  '''encrypt'''							)






def  _UpperCAmelCase						( __lowerCamelCase			,  __lowerCamelCase							)		->str:


 '''simple docstring'''
 return translate_message(__lowerCamelCase			,  __lowerCamelCase			,  '''decrypt'''							)






def  _UpperCAmelCase						( )		->None:


 '''simple docstring'''
 snake_case :			str							=   '''Hello World'''
 snake_case :			Optional[Any]							=   '''QWERTYUIOPASDFGHJKLZXCVBNM'''
 snake_case :			Any							=   '''decrypt'''  # set to 'encrypt' or 'decrypt'

 if mode == "encrypt":
  snake_case :			Optional[int]							=   encrypt_message(__lowerCamelCase			,  __lowerCamelCase							)
 elif mode == "decrypt":
  snake_case :			str							=   decrypt_message(__lowerCamelCase			,  __lowerCamelCase							)
 print(f'''Using the key {key}, the {mode}ed message is: {translated}'''							)


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  main()










import copy

from transformers.configuration_utils import PretrainedConfig
from transformers.utils import logging


a					:				Optional[Any]       =      logging.get_logger(__name__)

class   lowerCamelCase						(	SCREAMING_SNAKE_CASE  ):
       _UpperCamelCase     		=   """hybrid-clip"""
       _UpperCamelCase     		=   True

       def __init__(      self						,    a__=5_12						,    **a__       ):






        '''simple docstring'''






        super().__init__(**a__       )

        if "text_config" not in kwargs:
         raise ValueError('''`text_config` can not be `None`.'''       )

        if "vision_config" not in kwargs:
         raise ValueError('''`vision_config` can not be `None`.'''       )

        snake_case :			int							=   kwargs.pop('''text_config'''       )
        snake_case :			Optional[int]							=   kwargs.pop('''vision_config'''       )

        snake_case :			Optional[Any]							=   text_config.pop('''model_type'''       )
        snake_case :			str							=   vision_config.pop('''model_type'''       )

        from transformers import AutoConfig

        snake_case :			List[Any]							=   AutoConfig.for_model(a__						,    **a__       )

        if vision_model_type == "clip":
         snake_case :			Dict							=   AutoConfig.for_model(a__						,    **a__       ).vision_config
        elif vision_model_type == "clip_vision_model":
         from transformers import CLIPVisionConfig

         snake_case :			str							=   CLIPVisionConfig(**a__       )
        else:
         snake_case :			Any							=   AutoConfig.for_model(a__						,    **a__       )

        snake_case :			Optional[Any]							=   projection_dim
        snake_case :			int							=   1.0

       @classmethod
       def 					UpperCAmelCase					(      cls						,    a__						,    a__						,    **a__       ):






        '''simple docstring'''






        return cls(text_config=text_config.to_dict()						,    vision_config=vision_config.to_dict()						,    **a__       )



       def 					UpperCAmelCase					(      self       ):






        '''simple docstring'''






        snake_case :			Dict							=   copy.deepcopy(self.__dict__       )
        snake_case :			Dict							=   self.text_config.to_dict()
        snake_case :			int							=   self.vision_config.to_dict()
        snake_case :			List[Any]							=   self.__class__.model_type
        return output






