
import random

class     _UpperCamelCase			:






			'''simple docstring'''

			@staticmethod
			def  lowerCAmelCase__		(    snake_case_	:    str ):
							UpperCamelCase_:							Any		=  [ord(snake_case_ ) for i in text]
							UpperCamelCase_:							Union[str, Any]		=  []
							UpperCamelCase_:							Any		=  []
							for i in plain:
											UpperCamelCase_:							Any		=  random.randint(1  ,		300 )
											UpperCamelCase_:							Union[str, Any]		=  (i + k) * k
											cipher.append(snake_case_ )
											key.append(snake_case_ )
							return cipher, key




			@staticmethod
			def  lowerCAmelCase__		(    snake_case_	:    list[int]  ,		snake_case_	:    list[int] ):
							UpperCamelCase_:							List[Any]		=  []
							for i in range(len(snake_case_ ) ):
											UpperCamelCase_:							int		=  int((cipher[i] - (key[i]) ** 2) / key[i] )
											plain.append(chr(snake_case_ ) )
							return "".join(snake_case_ )


if __name__ == "__main__":
							lowerCamelCase_  :	Any						=					Onepad().encrypt("""Hello""")
							print(c, k)
							print(Onepad().decrypt(c, k))








import argparse

import torch

from transformers import GPTaConfig, GPTaModel, load_tf_weights_in_gpta
from transformers.utils import CONFIG_NAME, WEIGHTS_NAME, logging


logging.set_verbosity_info()







def     A__   (  lowerCamelCase       ,      lowerCamelCase       ,      lowerCamelCase  )					->		Union[str, Any]:
				# Construct model
				if gpta_config_file == "":
								UpperCamelCase_:							Union[str, Any]		=  GPTaConfig()
				else:
								UpperCamelCase_:							Optional[Any]		=  GPTaConfig.from_json_file(lowerCamelCase  )
				UpperCamelCase_:							List[Any]		=  GPTaModel(lowerCamelCase  )

				# Load weights from numpy
				load_tf_weights_in_gpta(lowerCamelCase       ,      lowerCamelCase       ,      lowerCamelCase  )

				# Save pytorch-model
				UpperCamelCase_:							int		=  pytorch_dump_folder_path + """/""" + WEIGHTS_NAME
				UpperCamelCase_:							Any		=  pytorch_dump_folder_path + """/""" + CONFIG_NAME
				print(F'''Save PyTorch model to {pytorch_weights_dump_path}'''  )
				torch.save(model.state_dict()       ,      lowerCamelCase  )
				print(F'''Save configuration file to {pytorch_config_dump_path}'''  )
				with open(lowerCamelCase       ,      """w"""       ,      encoding="""utf-8"""  ) as f:
								f.write(config.to_json_string()  )


if __name__ == "__main__":
							lowerCamelCase_  :	int 				=					argparse.ArgumentParser()
							# Required parameters
							parser.add_argument(
							    """--gpt2_checkpoint_path""", default=None, type=str, required=True, help="""Path to the TensorFlow checkpoint path."""
							)
							parser.add_argument(
							    """--pytorch_dump_folder_path""", default=None, type=str, required=True, help="""Path to the output PyTorch model."""
							)
							parser.add_argument(
							    """--gpt2_config_file""",
							    default="""""",
							    type=str,
							    help=(
							        """An optional config json file corresponding to the pre-trained OpenAI model. \n"""
							        """This specifies the model architecture."""
							    ),
							)
							lowerCamelCase_  :	List[str] 				=					parser.parse_args()
							convert_gpta_checkpoint_to_pytorch(args.gpta_checkpoint_path, args.gpta_config_file, args.pytorch_dump_folder_path)






