"""simple docstring"""







from importlib import import_module

from .logging import get_logger


_a					:					int=			get_logger(__name__)

class 		UpperCamelCase      :



				def __init__(self    :				Optional[Any]     ,  _A    :				Optional[Any]     ,  _A    :				List[Any]=None)   ->     Dict:
					__snake_case      :							List[Any]						=			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))
					__snake_case      :							Optional[int]						=			module._original_module if isinstance(_A     ,  _PatchedModuleObj) else module







class 		UpperCamelCase      :
				UpperCAmelCase    :				Optional[Any]   =		[]



				def __init__(self    :				str     ,  _A    :				Union[str, Any]     ,  _A    :				str     ,  _A    :				Tuple     ,  _A    :				List[Any]=None)   ->     Union[str, Any]:
					__snake_case      :							List[Any]						=			obj
					__snake_case      :							Tuple						=			target
					__snake_case      :							int						=			new
					__snake_case      :							Union[str, Any]						=			target.split('.')[0]
					__snake_case      :							Optional[int]						=			{}
					__snake_case      :							Dict						=			attrs or []



				def __enter__(self    :				Optional[Any])   ->     Optional[int]:
					*__snake_case		,    __snake_case      :							Dict						=			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:
							__snake_case      :							List[str]						=			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__():
							__snake_case      :							Union[str, Any]						=			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)
							):
								__snake_case      :							Optional[int]						=			obj_attr
								# patch at top level
								setattr(self.obj     ,  _A     ,  _PatchedModuleObj(_A     ,  attrs=self.attrs))
								__snake_case      :							Any						=			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))
									__snake_case      :							List[str]						=			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:
							__snake_case      :							str						=			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:
								__snake_case      :							str						=			getattr(self.obj     ,  _A)
								setattr(self.obj     ,  _A     ,  self.new)
					elif target_attr in globals()["__builtins__"]:  # if it'a s builtin like "open"
						__snake_case      :							Optional[int]						=			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    :				List[Any]     ,  *_A    :				Tuple)   ->     Dict:
					for attr in list(self.original):
						setattr(self.obj     ,  _A     ,  self.original.pop(_A))



				def  _lowercase					(self    :				int)   ->     Tuple:
					self.__enter__()
					self._active_patches.append(self)






				def  _lowercase					(self    :				List[str])   ->     List[str]:
					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"""







import warnings

from ...utils import logging
from .image_processing_videomae import VideoMAEImageProcessor


_a					:					Tuple=			logging.get_logger(__name__)

class 		UpperCamelCase      (   lowercase						):



				def __init__(self    :				int     ,  *_A    :				str     ,  **_A    :				List[str])   ->     None:
					warnings.warn(
					    'The class VideoMAEFeatureExtractor is deprecated and will be removed in version 5 of Transformers.'
					    ' Please use VideoMAEImageProcessor instead.'     ,  _A     ,  )
					super().__init__(*_A     ,  **_A)





