'''simple docstring'''




from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


__UpperCAmelCase												=logging.get_logger(__name__)

__UpperCAmelCase												={
    "facebook/convnextv2-tiny-1k-224": "https://huggingface.co/facebook/convnextv2-tiny-1k-224/resolve/main/config.json",
}




class    a__				(       UpperCAmelCase__							,       UpperCAmelCase__			):
     lowerCamelCase  :					Any							="convnextv2"






     def __init__(			self		:		List[str]  ,    a		:		str=3  ,    a		:		int=4  ,    a		:		Optional[int]=4  ,    a		:		Optional[int]=None  ,    a		:		Tuple=None  ,    a		:		int="gelu"  ,    a		:		Dict=0.02  ,    a		:		Any=1e-1_2  ,    a		:		str=0.0  ,    a		:		List[str]=2_24  ,    a		:		Optional[Any]=None  ,    a		:		Any=None  ,    **a		:		List[Any]  ,    ):





         """simple docstring"""



         super().__init__(**a   )

         __lowerCamelCase          =  num_channels
         __lowerCamelCase          =  patch_size
         __lowerCamelCase          =  num_stages
         __lowerCamelCase          =  [96, 1_92, 3_84, 7_68] if hidden_sizes is None else hidden_sizes
         __lowerCamelCase          =  [3, 3, 9, 3] if depths is None else depths
         __lowerCamelCase          =  hidden_act
         __lowerCamelCase          =  initializer_range
         __lowerCamelCase          =  layer_norm_eps
         __lowerCamelCase          =  drop_path_rate
         __lowerCamelCase          =  image_size
         __lowerCamelCase          =  ['''stem'''] + [f"""stage{idx}""" for idx in range(1  ,    len(self.depths   ) + 1   )]
         __lowerCamelCase     ,  __lowerCamelCase          =  get_aligned_output_features_output_indices(
             out_features=a  ,    out_indices=a  ,    stage_names=self.stage_names   )

'''simple docstring'''




__UpperCAmelCase												="ABCDEFGHIJKLMNOPQRSTUVWXYZ"






def __lowerCAmelCase			(							)     ->   None:
    __lowerCamelCase          =  input('''Enter message: '''    )
    __lowerCamelCase          =  input('''Enter key [alphanumeric]: '''    )
    __lowerCamelCase          =  input('''Encrypt/Decrypt [e/d]: '''    )

    if mode.lower().startswith('''e'''    ):
        __lowerCamelCase          =  '''encrypt'''
        __lowerCamelCase          =  encrypt_message(UpperCamelCase__    ,  UpperCamelCase__    )
    elif mode.lower().startswith('''d'''    ):
        __lowerCamelCase          =  '''decrypt'''
        __lowerCamelCase          =  decrypt_message(UpperCamelCase__    ,  UpperCamelCase__    )

    print(f"""\n{mode.title()}ed message:"""    )
    print(UpperCamelCase__    )






def __lowerCAmelCase			(							UpperCamelCase__    ,  UpperCamelCase__    )     ->   str:
    return translate_message(UpperCamelCase__    ,  UpperCamelCase__    ,  '''encrypt'''    )






def __lowerCAmelCase			(							UpperCamelCase__    ,  UpperCamelCase__    )     ->   str:
    return translate_message(UpperCamelCase__    ,  UpperCamelCase__    ,  '''decrypt'''    )






def __lowerCAmelCase			(							UpperCamelCase__    ,  UpperCamelCase__    ,  UpperCamelCase__    )     ->   str:
    __lowerCamelCase          =  []
    __lowerCamelCase          =  0
    __lowerCamelCase          =  key.upper()

    for symbol in message:
        __lowerCamelCase          =  LETTERS.find(symbol.upper()    )
        if num != -1:
            if mode == "encrypt":
                num += LETTERS.find(key[key_index]    )
            elif mode == "decrypt":
                num -= LETTERS.find(key[key_index]    )

            num %= len(UpperCamelCase__    )

            if symbol.isupper():
                translated.append(LETTERS[num]    )
            elif symbol.islower():
                translated.append(LETTERS[num].lower()    )

            key_index += 1
            if key_index == len(UpperCamelCase__    ):
                __lowerCamelCase          =  0
        else:
            translated.append(UpperCamelCase__    )
    return "".join(UpperCamelCase__    )


if __name__ == "__main__":
  main()
