


import unittest
from timeit import timeit



def      __lowerCAmelCase    (				snake_case						:     int    ,   snake_case						:     int			)							->				int:
   __lowerCamelCase:					List[str]	 =						first_num if first_num >= second_num else second_num
   __lowerCamelCase:					Any	 =						max_num
   while (common_mult % first_num > 0) or (common_mult % second_num > 0):
      common_mult += max_num
   return common_mult



def      __lowerCAmelCase    (				snake_case						:     int    ,   snake_case						:     int			)							->				int:
   return b if a == 0 else greatest_common_divisor(b % a    ,   snake_case			)



def      __lowerCAmelCase    (				snake_case						:     int    ,   snake_case						:     int			)							->				int:
   return first_num // greatest_common_divisor(snake_case    ,   snake_case			) * second_num



def      __lowerCAmelCase    (				)							->				Optional[int]:
   __lowerCamelCase:					str	 =						(
       """from __main__ import least_common_multiple_slow, least_common_multiple_fast"""
   )
   print(
       """least_common_multiple_slow():"""    ,   timeit("""least_common_multiple_slow(1000, 999)"""    ,   setup=snake_case			)    ,   )
   print(
       """least_common_multiple_fast():"""    ,   timeit("""least_common_multiple_fast(1000, 999)"""    ,   setup=snake_case			)    ,   )



class 							a       (      unittest.TestCase ):
     UpperCAmelCase__			:	Any       =						(
         (10, 20),
         (13, 15),
         (4, 31),
         (10, 42),
         (43, 34),
         (5, 12),
         (12, 25),
         (10, 25),
         (6, 9),
     )
     UpperCAmelCase__			:	Optional[Any]       =						(20, 195, 124, 210, 1462, 60, 300, 50, 18)





     def 			SCREAMING_SNAKE_CASE__							(     self       :					List[Any]				):
        for i, (first_num, second_num) in enumerate(self.test_inputs				):
           __lowerCamelCase:					Dict	 =						least_common_multiple_slow(SCREAMING_SNAKE_CASE_     ,						SCREAMING_SNAKE_CASE_				)
           __lowerCamelCase:					str	 =						least_common_multiple_fast(SCREAMING_SNAKE_CASE_     ,						SCREAMING_SNAKE_CASE_				)
           with self.subTest(i=SCREAMING_SNAKE_CASE_				):
              self.assertEqual(SCREAMING_SNAKE_CASE_     ,						self.expected_results[i]				)
              self.assertEqual(SCREAMING_SNAKE_CASE_     ,						self.expected_results[i]				)


if __name__ == "__main__":
   benchmark()
   unittest.main()






import argparse

from transformers import CanineConfig, CanineModel, CanineTokenizer, load_tf_weights_in_canine
from transformers.utils import logging


logging.set_verbosity_info()



def      __lowerCAmelCase    (				snake_case						:     Union[str, Any]    ,   snake_case						:     Optional[int]			)							->				List[Any]:
   # Initialize PyTorch model
   __lowerCamelCase:					str	 =						CanineConfig()
   __lowerCamelCase:					Union[str, Any]	 =						CanineModel(snake_case			)
   model.eval()

   print(f'Building PyTorch model from configuration: {config}'			)

   # Load weights from tf checkpoint
   load_tf_weights_in_canine(snake_case    ,   snake_case    ,   snake_case			)

   # Save pytorch-model (weights and configuration)
   print(f'Save PyTorch model to {pytorch_dump_path}'			)
   model.save_pretrained(snake_case			)

   # Save tokenizer files
   __lowerCamelCase:					Optional[int]	 =						CanineTokenizer()
   print(f'Save tokenizer files to {pytorch_dump_path}'			)
   tokenizer.save_pretrained(snake_case			)


if __name__ == "__main__":
   _A		:					int          =							argparse.ArgumentParser()
   # Required parameters
   parser.add_argument(
       '''--tf_checkpoint_path''',
       default=None,
       type=str,
       required=True,
       help='''Path to the TensorFlow checkpoint. Should end with model.ckpt''',
   )
   parser.add_argument(
       '''--pytorch_dump_path''',
       default=None,
       type=str,
       required=True,
       help='''Path to a folder where the PyTorch model will be placed.''',
   )
   _A		:					int          =							parser.parse_args()
   convert_tf_checkpoint_to_pytorch(args.tf_checkpoint_path, args.pytorch_dump_path)


