

"""simple docstring"""



import unittest
from timeit import timeit





def 			_snake_case  (     UpperCAmelCase_	:       int       , UpperCAmelCase_	:       int      ):
     A__				      =	first_num if first_num >= second_num else second_num
     A__				      =	max_num
     while (common_mult % first_num > 0) or (common_mult % second_num > 0):
          common_mult += max_num
     return common_mult





def 			_snake_case  (     UpperCAmelCase_	:       int       , UpperCAmelCase_	:       int      ):
     return b if a == 0 else greatest_common_divisor(b % a       , UpperCAmelCase_      )





def 			_snake_case  (     UpperCAmelCase_	:       int       , UpperCAmelCase_	:       int      ):
     return first_num // greatest_common_divisor(UpperCAmelCase_       , UpperCAmelCase_      ) * second_num





def 			_snake_case  (     ):
     A__				      =	(
         """from __main__ import least_common_multiple_slow, least_common_multiple_fast"""
     )
     print(
         """least_common_multiple_slow():"""       , timeit("""least_common_multiple_slow(1000, 999)"""       , setup=UpperCAmelCase_      )       , )
     print(
         """least_common_multiple_fast():"""       , timeit("""least_common_multiple_fast(1000, 999)"""       , setup=UpperCAmelCase_      )       , )



class        a    (							unittest.TestCase					):



    """simple docstring"""



    UpperCAmelCase    			=       (
        (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),
    )
    UpperCAmelCase    			=       (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 					UpperCamelCase						(  self:			Tuple							):






         """simple docstring"""


         for i, (first_num, second_num) in enumerate(self.test_inputs							):
              A__				      =	least_common_multiple_slow(UpperCamelCase     ,    UpperCamelCase							)
              A__				      =	least_common_multiple_fast(UpperCamelCase     ,    UpperCamelCase							)
              with self.subTest(i=UpperCamelCase							):
                   self.assertEqual(UpperCamelCase     ,    self.expected_results[i]							)
                   self.assertEqual(UpperCamelCase     ,    self.expected_results[i]							)


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









"""simple docstring"""



from typing import List

from tokenizers import NormalizedString, PreTokenizedString, normalizers



class        a    :



    """simple docstring"""



    def __init__(  self:			List[Any]     ,    UpperCamelCase:			str							):






         """simple docstring"""


         A__				      =	vocab
         A__				      =	normalizers.BertNormalizer(
             clean_text=UpperCamelCase     ,    handle_chinese_chars=UpperCamelCase     ,    strip_accents=UpperCamelCase     ,    lowercase=UpperCamelCase     ,    )
         try:
              import rjieba
         except ImportError:
              raise ImportError(
                  """You need to install rjieba to use RoFormerTokenizer. """
                  """See https://pypi.org/project/rjieba/ for installation."""							)
         A__				      =	rjieba

    def 					UpperCamelCase						(  self:			Optional[Any]     ,    UpperCamelCase:			int     ,    UpperCamelCase:			NormalizedString							):






         """simple docstring"""


         A__				      =	[]

         # this code slice normalized_string is too slow (6s) but test_alignement_methods can pass
         for token, start, end in self.jieba.tokenize(str(UpperCamelCase							)     ,    hmm=UpperCamelCase							):
              if token in self.vocab:
                   splits.append(normalized_string[start:end]							)
              else:
                   A__				      =	self.normalizers.normalize_str(UpperCamelCase							).split()
                   for token in token_list:
                        if token:
                             A__				      =	start + len(UpperCamelCase							)
                             splits.append(normalized_string[start:end]							)
                             A__				      =	end

        # this code test_alignement_methods can't pass but fast (300ms)
        # for token in self.jieba.cut(str(normalized_string), False):
        #     if token in self.vocab:
        #         splits.append(NormalizedString(token))
        #     else:
        #         token_list = self.normalizers.normalize_str(token).split()
        #         for token in token_list:
        #             if token:
        #                 splits.append(NormalizedString(token))

         return splits





    def 					UpperCamelCase						(  self:			Tuple     ,    UpperCamelCase:			PreTokenizedString							):






         """simple docstring"""


         pretok.split(self.jieba_split							)






