



'''simple docstring'''







import enum
import inspect
import warnings
from functools import wraps
from typing import Callable, Optional

from .logging import get_logger


SCREAMING_SNAKE_CASE__     : str				=   set()
SCREAMING_SNAKE_CASE__     : Union[str, Any]				=   get_logger(__name__)







def  SCREAMING_SNAKE_CASE__ (				SCREAMING_SNAKE_CASE = None     ):

		def decorator(SCREAMING_SNAKE_CASE     ):
				global _emitted_deprecation_warnings

				if inspect.isclass(SCREAMING_SNAKE_CASE     ):
						SCREAMING_SNAKE_CASE_						:Union[str, Any]										=      deprecated_class_or_function.__init__
						SCREAMING_SNAKE_CASE_						:Optional[int]										=      deprecated_class_or_function.__name__
				else:
						SCREAMING_SNAKE_CASE_						:Optional[Any]										=      deprecated_class_or_function
						SCREAMING_SNAKE_CASE_						:Union[str, Any]										=      deprecated_function.__name__
						# Support deprecating __init__ class method: class name instead
						SCREAMING_SNAKE_CASE_						:Optional[int]										=      name if name != '__init__' else deprecated_function.__qualname__.split('.'     )[-2]

				SCREAMING_SNAKE_CASE_						:List[Any]										=      (
				    F'{name} is deprecated and will be removed in the next major version of datasets.' + F' {help_message}'
				    if help_message
				    else ''
				)

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

				SCREAMING_SNAKE_CASE_						:Optional[int]										=      'deprecated'

				if inspect.isclass(SCREAMING_SNAKE_CASE     ):
						SCREAMING_SNAKE_CASE_						:Dict										=      wrapper
						return deprecated_class_or_function
				else:
						return wrapper

		return decorator




class 				__lowerCAmelCase(							enum.EnumMeta      ):






			def __getattribute__(   cls  :							int      ,       SCREAMING_SNAKE_CASE  :							Optional[Any]	):




					"""simple docstring"""







					SCREAMING_SNAKE_CASE_						:int										=      super().__getattribute__(SCREAMING_SNAKE_CASE	)
					if isinstance(SCREAMING_SNAKE_CASE      ,       enum.Enum	) and obj._on_access:
							obj._on_access()
					return obj






			def __getitem__(   cls  :							str      ,       SCREAMING_SNAKE_CASE  :							Optional[int]	):




					"""simple docstring"""







					SCREAMING_SNAKE_CASE_						:Optional[int]										=      super().__getitem__(SCREAMING_SNAKE_CASE	)
					if member._on_access:
							member._on_access()
					return member






			def __call__(   cls  :							Union[str, Any]      ,       SCREAMING_SNAKE_CASE  :							List[str]      ,       SCREAMING_SNAKE_CASE  :							List[Any]=None      ,       *, SCREAMING_SNAKE_CASE  :							List[str]=None      ,       SCREAMING_SNAKE_CASE  :							Optional[Any]=None      ,       SCREAMING_SNAKE_CASE  :							Tuple=None      ,       SCREAMING_SNAKE_CASE  :							Optional[int]=1	):




					"""simple docstring"""







					SCREAMING_SNAKE_CASE_						:Tuple										=      super().__call__(SCREAMING_SNAKE_CASE      ,       SCREAMING_SNAKE_CASE      ,       module=SCREAMING_SNAKE_CASE      ,       qualname=SCREAMING_SNAKE_CASE      ,       type=SCREAMING_SNAKE_CASE      ,       start=SCREAMING_SNAKE_CASE	)
					if isinstance(SCREAMING_SNAKE_CASE      ,       enum.Enum	) and obj._on_access:
							obj._on_access()
					return obj




class 				__lowerCAmelCase(							enum.Enum		,			metaclass=lowerCAmelCase__      ):






			def __new__(   cls  :							Tuple      ,       SCREAMING_SNAKE_CASE  :							Any	):




					"""simple docstring"""







					SCREAMING_SNAKE_CASE_						:Tuple										=      object.__new__(cls	)
					SCREAMING_SNAKE_CASE_						:int										=      value
					SCREAMING_SNAKE_CASE_						:Optional[Any]										=      member.deprecate
					return member






			@property
			def 				_lowercase	(   self  :							Optional[int]	):




					"""simple docstring"""







					return ""






			def 				_lowercase	(   self  :							List[str]	):




					"""simple docstring"""







					SCREAMING_SNAKE_CASE_						:List[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      ,       SCREAMING_SNAKE_CASE      ,       stacklevel=3      ,       )

from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
    is_vision_available,
)


__snake_case         =     {
    '''configuration_mobilevitv2''': [
        '''MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''MobileViTV2Config''',
        '''MobileViTV2OnnxConfig''',
    ],
}


try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     __snake_case         =     [
         '''MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST''',
         '''MobileViTV2ForImageClassification''',
         '''MobileViTV2ForSemanticSegmentation''',
         '''MobileViTV2Model''',
         '''MobileViTV2PreTrainedModel''',
     ]

if TYPE_CHECKING:
     from .configuration_mobilevitva import (
         MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP,
         MobileViTVaConfig,
         MobileViTVaOnnxConfig,
     )

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_mobilevitva import (
              MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST,
              MobileViTVaForImageClassification,
              MobileViTVaForSemanticSegmentation,
              MobileViTVaModel,
              MobileViTVaPreTrainedModel,
          )

else:
     import sys

     __snake_case         =     _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)
