


'''simple docstring'''
import enum
import inspect
import warnings
from functools import wraps
from typing import Callable, Optional

from .logging import get_logger


lowerCAmelCase__  =     set()
lowerCAmelCase__  =     get_logger(__name__)



def 				lowerCAmelCase__	(       UpperCAmelCase = None     ):






       """simple docstring"""





       def decorator(UpperCAmelCase     ):
              global _emitted_deprecation_warnings

              if inspect.isclass(UpperCAmelCase     ):
                     snake_case__					:	int          =					deprecated_class_or_function.__init__
                     snake_case__					:	Dict          =					deprecated_class_or_function.__name__
              else:
                     snake_case__					:	Optional[Any]          =					deprecated_class_or_function
                     snake_case__					:	str          =					deprecated_function.__name__
                     # Support deprecating __init__ class method: class name instead
                     snake_case__					:	str          =					name if name != """__init__""" else deprecated_function.__qualname__.split("""."""     )[-2]

              snake_case__					:	Optional[Any]          =					(
                  f"""{name} is deprecated and will be removed in the next major version of datasets.""" + f""" {help_message}"""
                  if help_message
                  else """"""
              )

              @wraps(UpperCAmelCase     )
              def wrapper(*UpperCAmelCase    ,       **UpperCAmelCase     ):
                     snake_case__					:	Any          =					hash(UpperCAmelCase     )
                     if func_hash not in _emitted_deprecation_warnings:
                            warnings.warn(UpperCAmelCase    ,       category=UpperCAmelCase    ,       stacklevel=2     )
                            _emitted_deprecation_warnings.add(UpperCAmelCase     )
                     return deprecated_function(*UpperCAmelCase    ,       **UpperCAmelCase     )

              snake_case__					:	str          =					"""deprecated"""

              if inspect.isclass(UpperCAmelCase     ):
                     snake_case__					:	Union[str, Any]          =					wrapper
                     return deprecated_class_or_function
              else:
                     return wrapper

       return decorator







class 					_A						(						enum.EnumMeta							):



   '''simple docstring'''






   def __getattribute__(	cls	:					str					, lowerCamelCase	:					Optional[int]						)->	int:
          snake_case__					:	Optional[Any]          =					super().__getattribute__(lowerCamelCase						)
          if isinstance(lowerCamelCase					, enum.Enum						) and obj._on_access:
                 obj._on_access()
          return obj




   def __getitem__(	cls	:					Optional[Any]					, lowerCamelCase	:					Optional[Any]						)->	List[Any]:
          snake_case__					:	Tuple          =					super().__getitem__(lowerCamelCase						)
          if member._on_access:
                 member._on_access()
          return member




   def __call__(	cls	:					Optional[int]					, lowerCamelCase	:					Dict					, lowerCamelCase	:					int=None					, *, lowerCamelCase	:					Union[str, Any]=None					, lowerCamelCase	:					str=None					, lowerCamelCase	:					List[Any]=None					, lowerCamelCase	:					Union[str, Any]=1						)->	Optional[Any]:
          snake_case__					:	Dict          =					super().__call__(lowerCamelCase					, lowerCamelCase					, module=lowerCamelCase					, qualname=lowerCamelCase					, type=lowerCamelCase					, start=lowerCamelCase						)
          if isinstance(lowerCamelCase					, enum.Enum						) and obj._on_access:
                 obj._on_access()
          return obj







class 					_A						(						enum.Enum    ,  metaclass=UpperCamelCase							):



   '''simple docstring'''






   def __new__(	cls	:					List[Any]					, lowerCamelCase	:					Tuple						)->	List[Any]:
          snake_case__					:	int          =					object.__new__(cls						)
          snake_case__					:	List[str]          =					value
          snake_case__					:	Tuple          =					member.deprecate
          return member




   @property
   def   __lowerCAmelCase						(	self	:					int						)->	Tuple:
          return ""




   def   __lowerCAmelCase						(	self	:					Optional[Any]						)->	int:
          snake_case__					:	Any          =					F""" {self.help_message}""" if self.help_message else """"""
          warnings.warn(
              F"""'{self.__objclass__.__name__}' is deprecated and will be removed in the next major version of datasets."""
              + help_message					, lowerCamelCase					, stacklevel=3					, )








'''simple docstring'''
import unittest
from timeit import timeit



def 				lowerCAmelCase__	(       UpperCAmelCase    ,       UpperCAmelCase     ):






       """simple docstring"""





       snake_case__					:	Any          =					first_num if first_num >= second_num else second_num
       snake_case__					:	Optional[Any]          =					max_num
       while (common_mult % first_num > 0) or (common_mult % second_num > 0):
              common_mult += max_num
       return common_mult



def 				lowerCAmelCase__	(       UpperCAmelCase    ,       UpperCAmelCase     ):






       """simple docstring"""





       return b if a == 0 else greatest_common_divisor(b % a    ,       UpperCAmelCase     )



def 				lowerCAmelCase__	(       UpperCAmelCase    ,       UpperCAmelCase     ):






       """simple docstring"""





       return first_num // greatest_common_divisor(UpperCAmelCase    ,       UpperCAmelCase     ) * second_num



def 				lowerCAmelCase__	(       ):






       """simple docstring"""





       snake_case__					:	Tuple          =					(
           """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'''






   _lowercase    						= (
       (10, 20),
       (13, 15),
       (4, 31),
       (10, 42),
       (43, 34),
       (5, 12),
       (12, 25),
       (10, 25),
       (6, 9),
   )
   _lowercase    						= (20, 195, 124, 210, 1462, 60, 300, 50, 18)




   def   __lowerCAmelCase						(	self	:					Optional[int]						)->	Optional[Any]:
          for i, (first_num, second_num) in enumerate(self.test_inputs						):
                 snake_case__					:	List[Any]          =					least_common_multiple_slow(lowerCamelCase					, lowerCamelCase						)
                 snake_case__					:	Optional[Any]          =					least_common_multiple_fast(lowerCamelCase					, lowerCamelCase						)
                 with self.subTest(i=lowerCamelCase						):
                        self.assertEqual(lowerCamelCase					, self.expected_results[i]						)
                        self.assertEqual(lowerCamelCase					, self.expected_results[i]						)


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




