






"""simple docstring"""


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

from .logging import get_logger


lowercase_								=	set()
lowercase_								=	get_logger(__name__)



def    lowerCAmelCase							(       __UpperCamelCase = None					):




  """simple docstring"""







  def decorator(__UpperCamelCase					):
    global _emitted_deprecation_warnings

    if inspect.isclass(__UpperCamelCase					):
      __A		     =					deprecated_class_or_function.__init__
      __A		     =					deprecated_class_or_function.__name__
    else:
      __A		     =					deprecated_class_or_function
      __A		     =					deprecated_function.__name__
      # Support deprecating __init__ class method: class name instead
      __A		     =					name if name != '''__init__''' else deprecated_function.__qualname__.split('''.'''					)[-2]

    __A		     =					(
        f'{name} is deprecated and will be removed in the next major version of datasets.' + f' {help_message}'
        if help_message
        else ''''''
    )

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

    __A		     =					'''deprecated'''

    if inspect.isclass(__UpperCamelCase					):
      __A		     =					wrapper
      return deprecated_class_or_function
    else:
      return wrapper

  return decorator


class    snake_case						(				enum.EnumMeta		):


   '''simple docstring'''

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

     '''simple docstring'''
     __A		     =					super().__getattribute__(_lowerCamelCase    )
     if isinstance(_lowerCamelCase,			enum.Enum    ) and obj._on_access:
       obj._on_access()
     return obj


   def __getitem__(      cls					:	Dict,			_lowerCamelCase					:	Any    ):

     '''simple docstring'''
     __A		     =					super().__getitem__(_lowerCamelCase    )
     if member._on_access:
       member._on_access()
     return member






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

     '''simple docstring'''
     __A		     =					super().__call__(_lowerCamelCase,			_lowerCamelCase,			module=_lowerCamelCase,			qualname=_lowerCamelCase,			type=_lowerCamelCase,			start=_lowerCamelCase    )
     if isinstance(_lowerCamelCase,			enum.Enum    ) and obj._on_access:
       obj._on_access()
     return obj





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


   '''simple docstring'''

   def __new__(      cls					:	Union[str, Any],			_lowerCamelCase					:	Any    ):

     '''simple docstring'''
     __A		     =					object.__new__(cls    )
     __A		     =					value
     __A		     =					member.deprecate
     return member


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

     '''simple docstring'''
     return ""






   def 							_SCREAMING_SNAKE_CASE							(      self					:	int    ):

     '''simple docstring'''
     __A		     =					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,			_lowerCamelCase,			stacklevel=3,			)






"""simple docstring"""




from typing import TYPE_CHECKING

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


A__   :						Optional[Any] 							=     {"""configuration_vilt""": ["""VILT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """ViltConfig"""]}

try:
    if not is_vision_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    A__   :						List[Any] 							=     ["""ViltFeatureExtractor"""]
    A__   :						Any 							=     ["""ViltImageProcessor"""]
    A__   :						int 							=     ["""ViltProcessor"""]

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    A__   :						str 							=     [
        """VILT_PRETRAINED_MODEL_ARCHIVE_LIST""",
        """ViltForImageAndTextRetrieval""",
        """ViltForImagesAndTextClassification""",
        """ViltForTokenClassification""",
        """ViltForMaskedLM""",
        """ViltForQuestionAnswering""",
        """ViltLayer""",
        """ViltModel""",
        """ViltPreTrainedModel""",
    ]


if TYPE_CHECKING:
    from .configuration_vilt import VILT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViltConfig

    try:
        if not is_vision_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .feature_extraction_vilt import ViltFeatureExtractor
        from .image_processing_vilt import ViltImageProcessor
        from .processing_vilt import ViltProcessor

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_vilt import (
            VILT_PRETRAINED_MODEL_ARCHIVE_LIST,
            ViltForImageAndTextRetrieval,
            ViltForImagesAndTextClassification,
            ViltForMaskedLM,
            ViltForQuestionAnswering,
            ViltForTokenClassification,
            ViltLayer,
            ViltModel,
            ViltPreTrainedModel,
        )


else:
    import sys

    A__   :						Any 							=     _LazyModule(__name__, globals()["""__file__"""], _import_structure)



