





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_		(					lowerCAmelCase:		Optional[str] = None )->						List[str]:

  def decorator(lowerCAmelCase:		Callable ):
    global _emitted_deprecation_warnings

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

    _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(lowerCAmelCase )
    def wrapper(*lowerCAmelCase:		str			,							**lowerCAmelCase:		Any ):
      _snake_case      : Optional[int]														=		hash(lowerCAmelCase )
      if func_hash not in _emitted_deprecation_warnings:
        warnings.warn(lowerCAmelCase			,							category=lowerCAmelCase			,							stacklevel=2 )
        _emitted_deprecation_warnings.add(lowerCAmelCase )
      return deprecated_function(*lowerCAmelCase			,							**lowerCAmelCase )

    _snake_case      : Any														=		'deprecated'

    if inspect.isclass(lowerCAmelCase ):
      _snake_case      : Optional[Any]														=		wrapper
      return deprecated_class_or_function
    else:
      return wrapper

  return decorator



class 				_lowerCAmelCase			(	enum.EnumMeta							):


  '''simple docstring'''







  def __getattribute__(					cls					:    List[str]					, UpperCamelCase					:    str							):


    '''simple docstring'''





    _snake_case      : List[str]														=		super().__getattribute__(UpperCamelCase							)
    if isinstance(UpperCamelCase					, enum.Enum							) and obj._on_access:
      obj._on_access()
    return obj







  def __getitem__(					cls					:    Tuple					, UpperCamelCase					:    Tuple							):


    '''simple docstring'''





    _snake_case      : Optional[int]														=		super().__getitem__(UpperCamelCase							)
    if member._on_access:
      member._on_access()
    return member







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


    '''simple docstring'''





    _snake_case      : Dict														=		super().__call__(UpperCamelCase					, UpperCamelCase					, module=UpperCamelCase					, qualname=UpperCamelCase					, type=UpperCamelCase					, start=UpperCamelCase							)
    if isinstance(UpperCamelCase					, enum.Enum							) and obj._on_access:
      obj._on_access()
    return obj




class 				_lowerCAmelCase			(	enum.Enum							,			metaclass=UpperCAmelCase_							):


  '''simple docstring'''







  def __new__(					cls					:    Optional[int]					, UpperCamelCase					:    Dict							):


    '''simple docstring'''





    _snake_case      : List[Any]														=		object.__new__(cls							)
    _snake_case      : Dict														=		value
    _snake_case      : Optional[int]														=		member.deprecate
    return member







  @property
  def UpperCamelCase_       (					self					:    Any							):


    '''simple docstring'''





    return ""







  def UpperCamelCase_       (					self					:    Any							):


    '''simple docstring'''





    _snake_case      : int														=		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					, UpperCamelCase					, stacklevel=3					, )











from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_snake_case				= {"""configuration_dinat""": ["""DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """DinatConfig"""]}


try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _snake_case				= [
      """DINAT_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """DinatForImageClassification""",
      """DinatModel""",
      """DinatPreTrainedModel""",
      """DinatBackbone""",
  ]

if TYPE_CHECKING:
  from .configuration_dinat import DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP, DinatConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_dinat import (
        DINAT_PRETRAINED_MODEL_ARCHIVE_LIST,
        DinatBackbone,
        DinatForImageClassification,
        DinatModel,
        DinatPreTrainedModel,
    )

else:
  import sys

  _snake_case				= _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)






