


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

from .logging import get_logger


a				:							List[str]					=			set()
a				:							List[Any]					=			get_logger(__name__)






def    _UpperCAmelCase	(   __lowerCamelCase = None       )		->Any:


 '''simple docstring'''

 def decorator(__lowerCamelCase       ):
  global _emitted_deprecation_warnings

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

  snake_case   : Optional[int]	  =      (
      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 ,     **__lowerCamelCase       ):
   snake_case   : Optional[Any]	  =      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   : Optional[int]	  =      '''deprecated'''

  if inspect.isclass(__lowerCamelCase       ):
   snake_case   : int	  =      wrapper
   return deprecated_class_or_function
  else:
   return wrapper

 return decorator

class      lowerCamelCase	(  enum.EnumMeta     ):

       def __getattribute__(			cls	,						a__					):






        '''simple docstring'''






        snake_case   : str	  =      super().__getattribute__(a__					)
        if isinstance(a__	,						enum.Enum					) and obj._on_access:
         obj._on_access()
        return obj

       def __getitem__(			cls	,						a__					):






        '''simple docstring'''






        snake_case   : List[Any]	  =      super().__getitem__(a__					)
        if member._on_access:
         member._on_access()
        return member



       def __call__(			cls	,						a__	,						a__=None	,						*, a__=None	,						a__=None	,						a__=None	,						a__=1					):






        '''simple docstring'''






        snake_case   : Any	  =      super().__call__(a__	,						a__	,						module=a__	,						qualname=a__	,						type=a__	,						start=a__					)
        if isinstance(a__	,						enum.Enum					) and obj._on_access:
         obj._on_access()
        return obj







class      lowerCamelCase	(  enum.Enum,			metaclass=SCREAMING_SNAKE_CASE     ):

       def __new__(			cls	,						a__					):






        '''simple docstring'''






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

       @property
       def 				UpperCAmelCase				(			self					):






        '''simple docstring'''






        return ""



       def 				UpperCAmelCase				(			self					):






        '''simple docstring'''






        snake_case   : str	  =      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	,						a__	,						stacklevel=3	,						)










from typing import TYPE_CHECKING

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


a				:							List[str]					=			{
    'configuration_donut_swin': ['DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DonutSwinConfig'],
    'processing_donut': ['DonutProcessor'],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  a				:							Dict					=			[
      'DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST',
      'DonutSwinModel',
      'DonutSwinPreTrainedModel',
  ]

try:
  if not is_vision_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  a				:							Any					=			['DonutFeatureExtractor']
  a				:							Dict					=			['DonutImageProcessor']


if TYPE_CHECKING:
  from .configuration_donut_swin import DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, DonutSwinConfig
  from .processing_donut import DonutProcessor

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_donut_swin import (
        DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
        DonutSwinModel,
        DonutSwinPreTrainedModel,
    )

  try:
    if not is_vision_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .feature_extraction_donut import DonutFeatureExtractor
    from .image_processing_donut import DonutImageProcessor

else:
  import sys

  a				:							Union[str, Any]					=			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)






