



'''simple docstring'''







import unittest
from timeit import timeit







def  SCREAMING_SNAKE_CASE__ (				SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     ):
		SCREAMING_SNAKE_CASE_						:Optional[Any]										=      first_num if first_num >= second_num else second_num
		SCREAMING_SNAKE_CASE_						:List[str]										=      max_num
		while (common_mult % first_num > 0) or (common_mult % second_num > 0):
				common_mult += max_num
		return common_mult







def  SCREAMING_SNAKE_CASE__ (				SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     ):
		return b if a == 0 else greatest_common_divisor(b % a ,		SCREAMING_SNAKE_CASE     )







def  SCREAMING_SNAKE_CASE__ (				SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     ):
		return first_num // greatest_common_divisor(SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     ) * second_num







def  SCREAMING_SNAKE_CASE__ (				):
		SCREAMING_SNAKE_CASE_						: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=SCREAMING_SNAKE_CASE     ) ,		)
		print(
		    'least_common_multiple_fast():' ,		timeit('least_common_multiple_fast(1000, 999)' ,		setup=SCREAMING_SNAKE_CASE     ) ,		)




class 				__lowerCAmelCase(							unittest.TestCase      ):
			__snake_case  :		List[str]		=      (
			    (1_0, 2_0),
			    (1_3, 1_5),
			    (4, 3_1),
			    (1_0, 4_2),
			    (4_3, 3_4),
			    (5, 1_2),
			    (1_2, 2_5),
			    (1_0, 2_5),
			    (6, 9),
			)
			__snake_case  :		str		=      (2_0, 1_9_5, 1_2_4, 2_1_0, 1_4_6_2, 6_0, 3_0_0, 5_0, 1_8)






			def 				_lowercase	(   self  :							Any	):




					"""simple docstring"""







					for i, (first_num, second_num) in enumerate(self.test_inputs	):
							SCREAMING_SNAKE_CASE_						:Tuple										=      least_common_multiple_slow(SCREAMING_SNAKE_CASE      ,       SCREAMING_SNAKE_CASE	)
							SCREAMING_SNAKE_CASE_						: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    UpperCAmelCase							(  _snake_case    ,			_snake_case				):
							# Initialize PyTorch model
							lowerCAmelCase =		CanineConfig()
							lowerCAmelCase =		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 =		CanineTokenizer()
							print(F"""Save tokenizer files to {pytorch_dump_path}"""				)
							tokenizer.save_pretrained(_snake_case				)


if __name__ == "__main__":
		UpperCAmelCase_    =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.""",
		)
		UpperCAmelCase_    =parser.parse_args()
		convert_tf_checkpoint_to_pytorch(args.tf_checkpoint_path, args.pytorch_dump_path)



