





from __future__ import annotations

UpperCamelCase__      =[True] * 100_0001
UpperCamelCase__      =2
while i * i <= 100_0000:
       if seive[i]:
              for j in range(i * i, 100_0001, i):
                     UpperCamelCase__      =False
       i += 1






def     lowerCamelCase__			(__lowerCamelCase	):
     return seive[n]






def     lowerCamelCase__			(__lowerCamelCase	):
     return any(digit in "02468" for digit in str(__lowerCamelCase	)	)






def     lowerCamelCase__			(__lowerCamelCase = 1000000	):
     _SCREAMING_SNAKE_CASE       :	Optional[Any]						    =							[2]  # result already includes the number 2.
     for num in range(3,       limit + 1,       2	):
          if is_prime(__lowerCamelCase	) and not contains_an_even_digit(__lowerCamelCase	):
               _SCREAMING_SNAKE_CASE       :	List[Any]						    =							str(__lowerCamelCase	)
               _SCREAMING_SNAKE_CASE       :	Optional[Any]						    =							[int(str_num[j:] + str_num[:j]	) for j in range(len(__lowerCamelCase	)	)]
               if all(is_prime(__lowerCamelCase	) for i in list_nums	):
                    result.append(__lowerCamelCase	)
     return result






def     lowerCamelCase__			():
     return len(find_circular_primes()	)


if __name__ == "__main__":
       print(f"{len(find_circular_primes()) = }")






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     lowerCamelCase__			(__lowerCamelCase,       __lowerCamelCase,       __lowerCamelCase	):
     # Construct model
     if gpta_config_file == "":
          _SCREAMING_SNAKE_CASE       :	str						    =							GPTaConfig()
     else:
          _SCREAMING_SNAKE_CASE       :	int						    =							GPTaConfig.from_json_file(__lowerCamelCase	)
     _SCREAMING_SNAKE_CASE       :	Dict						    =							GPTaModel(__lowerCamelCase	)

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

     # Save pytorch-model
     _SCREAMING_SNAKE_CASE       :	Optional[Any]						    =							pytorch_dump_folder_path + "/" + WEIGHTS_NAME
     _SCREAMING_SNAKE_CASE       :	Tuple						    =							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__":
       UpperCamelCase__      =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.'
           ),
       )
       UpperCamelCase__      =parser.parse_args()
       convert_gpta_checkpoint_to_pytorch(args.gpta_checkpoint_path, args.gpta_config_file, args.pytorch_dump_folder_path)