'''simple docstring'''




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


_lowercase		:				Dict	       =		logging.get_logger(__name__)

_lowercase		:				Tuple	       =		{"openai-gpt": "https://huggingface.co/openai-gpt/resolve/main/config.json"}





class 					__magic_name__		(					_UpperCAmelCase):
			UpperCamelCase__       = '''openai-gpt'''
			UpperCamelCase__       = {
			    '''max_position_embeddings''': '''n_positions''',
			    '''hidden_size''': '''n_embd''',
			    '''num_attention_heads''': '''n_head''',
			    '''num_hidden_layers''': '''n_layer''',
			}







			def __init__(			self       :						Optional[int]       ,    lowercase_       :						str=40478       ,    lowercase_       :						Optional[Any]=512       ,    lowercase_       :						str=768       ,    lowercase_       :						List[str]=12       ,    lowercase_       :						Tuple=12       ,    lowercase_       :						str="gelu"       ,    lowercase_       :						Union[str, Any]=0.1       ,    lowercase_       :						str=0.1       ,    lowercase_       :						Dict=0.1       ,    lowercase_       :						int=1E-5       ,    lowercase_       :						List[str]=0.02       ,    lowercase_       :						Dict="cls_index"       ,    lowercase_       :						List[Any]=True       ,    lowercase_       :						int=None       ,    lowercase_       :						List[str]=True       ,    lowercase_       :						List[Any]=0.1       ,    **lowercase_       :						List[Any]       ,    ):
										lowercase_      :    Optional[Any]       		= vocab_size
										lowercase_      :    List[Any]       		= n_positions
										lowercase_      :    List[str]       		= n_embd
										lowercase_      :    Dict       		= n_layer
										lowercase_      :    List[str]       		= n_head
										lowercase_      :    List[Any]       		= afn
										lowercase_      :    Any       		= resid_pdrop
										lowercase_      :    Tuple       		= embd_pdrop
										lowercase_      :    Union[str, Any]       		= attn_pdrop
										lowercase_      :    Optional[int]       		= layer_norm_epsilon
										lowercase_      :    int       		= initializer_range
										lowercase_      :    List[Any]       		= summary_type
										lowercase_      :    Any       		= summary_use_proj
										lowercase_      :    str       		= summary_activation
										lowercase_      :    Tuple       		= summary_first_dropout
										lowercase_      :    Tuple       		= summary_proj_to_labels
										super().__init__(**lowercase_					)






'''simple docstring'''




_lowercase		:				int	       =		"ABCDEFGHIJKLMNOPQRSTUVWXYZ"




def 							lowerCamelCase			(   )    ->   None:
							lowercase_      :    List[Any]       		= input("""Enter message: """				)
							lowercase_      :    str       		= input("""Enter key [alphanumeric]: """				)
							lowercase_      :    List[Any]       		= input("""Encrypt/Decrypt [e/d]: """				)

							if mode.lower().startswith("""e"""				):
														lowercase_      :    List[str]       		= """encrypt"""
														lowercase_      :    Optional[int]       		= encrypt_message(UpperCAmelCase__   ,   UpperCAmelCase__				)
							elif mode.lower().startswith("""d"""				):
														lowercase_      :    Any       		= """decrypt"""
														lowercase_      :    Optional[Any]       		= decrypt_message(UpperCAmelCase__   ,   UpperCAmelCase__				)

							print(F'''\n{mode.title()}ed message:'''				)
							print(UpperCAmelCase__				)




def 							lowerCamelCase			(   UpperCAmelCase__ :      str   ,   UpperCAmelCase__ :      str				)    ->   str:
							return translate_message(UpperCAmelCase__   ,   UpperCAmelCase__   ,   """encrypt"""				)




def 							lowerCamelCase			(   UpperCAmelCase__ :      str   ,   UpperCAmelCase__ :      str				)    ->   str:
							return translate_message(UpperCAmelCase__   ,   UpperCAmelCase__   ,   """decrypt"""				)




def 							lowerCamelCase			(   UpperCAmelCase__ :      str   ,   UpperCAmelCase__ :      str   ,   UpperCAmelCase__ :      str				)    ->   str:
							lowercase_      :    Union[str, Any]       		= []
							lowercase_      :    List[Any]       		= 0
							lowercase_      :    str       		= key.upper()

							for symbol in message:
														lowercase_      :    Tuple       		= 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__				):
																												lowercase_      :    Any       		= 0
														else:
																					translated.append(UpperCAmelCase__				)
							return "".join(UpperCAmelCase__				)


if __name__ == "__main__":
						main()





