


"""simple docstring"""




from importlib import import_module

from .logging import get_logger


lowercase_			     =  get_logger(__name__)
class 					__lowerCAmelCase					:


		'''simple docstring'''



		def __init__(  self							, _a							, _a=None      ):
				__a           =			attrs or []
				if module is not None:
						for key in module.__dict__:
								if key in attrs or not key.startswith('''__'''      ):
										setattr(self							, _a							, getattr(_a							, _a      )      )
				__a           =			module._original_module if isinstance(_a							, _PatchedModuleObj      ) else module







class 					__lowerCAmelCase					:


		'''simple docstring'''



		__UpperCAmelCase		:			int										=				[]

		def __init__(  self							, _a							, _a							, _a							, _a=None      ):
				__a           =			obj
				__a           =			target
				__a           =			new
				__a           =			target.split('''.'''      )[0]
				__a           =			{}
				__a           =			attrs or []

		def __enter__(  self      ):
				*__a      ,     __a           =			self.target.split('''.'''      )

				# Patch modules:
				# it's used to patch attributes of submodules like "os.path.join";
				# in this case we need to patch "os" and "os.path"

				for i in range(len(_a      )      ):
						try:
								__a           =			import_module('''.'''.join(submodules[: i + 1]      )      )
						except ModuleNotFoundError:
								continue
						# We iterate over all the globals in self.obj in case we find "os" or "os.path"
						for attr in self.obj.__dir__():
								__a           =			getattr(self.obj							, _a      )
								# We don't check for the name of the global, but rather if its value *is* "os" or "os.path".
								# This allows to patch renamed modules like "from os import path as ospath".
								if obj_attr is submodule or (
								    (isinstance(_a							, _PatchedModuleObj      ) and obj_attr._original_module is submodule)
								):
										__a           =			obj_attr
										# patch at top level
										setattr(self.obj							, _a							, _PatchedModuleObj(_a							, attrs=self.attrs      )      )
										__a           =			getattr(self.obj							, _a      )
										# construct lower levels patches
										for key in submodules[i + 1 :]:
												setattr(_a							, _a							, _PatchedModuleObj(getattr(_a							, _a							, _a      )							, attrs=self.attrs      )      )
												__a           =			getattr(_a							, _a      )
										# finally set the target attribute
										setattr(_a							, _a							, self.new      )

        # Patch attribute itself:
        # it's used for builtins like "open",
        # and also to patch "os.path.join" we may also need to patch "join"
        # itself if it was imported as "from os.path import join".

				if submodules:  # if it's an attribute of a submodule like "os.path.join"
						try:
								__a           =			getattr(import_module('''.'''.join(_a      )      )							, _a      )
						except (AttributeError, ModuleNotFoundError):
								return
						# We iterate over all the globals in self.obj in case we find "os.path.join"
						for attr in self.obj.__dir__():
								# We don't check for the name of the global, but rather if its value *is* "os.path.join".
								# This allows to patch renamed attributes like "from os.path import join as pjoin".
								if getattr(self.obj							, _a      ) is attr_value:
										__a           =			getattr(self.obj							, _a      )
										setattr(self.obj							, _a							, self.new      )
				elif target_attr in globals()["__builtins__"]:  # if it'a s builtin like "open"
						__a           =			globals()['''__builtins__'''][target_attr]
						setattr(self.obj							, _a							, self.new      )
				else:
						raise RuntimeError(f'''Tried to patch attribute {target_attr} instead of a submodule.'''      )

		def __exit__(  self							, *_a      ):
				for attr in list(self.original      ):
						setattr(self.obj							, _a							, self.original.pop(_a      )      )

		def 			__UpperCAmelCase       (  self      ):
				self.__enter__()
				self._active_patches.append(self      )





		def 			__UpperCAmelCase       (  self      ):
				try:
						self._active_patches.remove(self      )
				except ValueError:
						# If the patch hasn't been started this will fail
						return None

				return self.__exit__()







'''simple docstring'''





def 	lowerCAmelCase_				(					snake_case_       : int					,    snake_case_       : int			)    ->      int:


     '''simple docstring'''




     return x if y == 0 else greatest_common_divisor(snake_case_					,    x % y			)





def 	lowerCAmelCase_				(					snake_case_       : int					,    snake_case_       : int			)    ->      int:


     '''simple docstring'''




     return (x * y) // greatest_common_divisor(snake_case_					,    snake_case_			)





def 	lowerCAmelCase_				(					snake_case_       : int = 20			)    ->      int:


     '''simple docstring'''




     UpperCAmelCase_           =   1
     for i in range(1					,    n + 1			):
          UpperCAmelCase_           =   lcm(snake_case_					,    snake_case_			)
     return g


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




