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

from .logging import get_logger


A		:   int         =    set()
A		:   Any         =    get_logger(__name__)




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  Optional[str] = None					)     ->    List[str]:

						def decorator(SCREAMING_SNAKE_CASE_  :  Callable					):
												global _emitted_deprecation_warnings

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

												_lowercase									=				(
												    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_  :  List[str]		,      **SCREAMING_SNAKE_CASE_  :  List[Any]					):
																		_lowercase									=				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_					)

												_lowercase									=				"""deprecated"""

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

						return decorator



class       a_   ( enum.EnumMeta						):






			def __getattribute__(			cls							, __UpperCamelCase     ):
									_lowercase									=				super().__getattribute__(__UpperCamelCase     )
									if isinstance(__UpperCamelCase							, enum.Enum     ) and obj._on_access:
															obj._on_access()
									return obj






			def __getitem__(			cls							, __UpperCamelCase     ):
									_lowercase									=				super().__getitem__(__UpperCamelCase     )
									if member._on_access:
															member._on_access()
									return member






			def __call__(			cls							, __UpperCamelCase							, __UpperCamelCase=None							, *, __UpperCamelCase=None							, __UpperCamelCase=None							, __UpperCamelCase=None							, __UpperCamelCase=1     ):
									_lowercase									=				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       a_   ( enum.Enum				, metaclass=_a						):






			def __new__(			cls							, __UpperCamelCase     ):
									_lowercase									=				object.__new__(cls     )
									_lowercase									=				value
									_lowercase									=				member.deprecate
									return member






			@property
			def       UpperCamelCase_							(			self     ):
									return ""






			def       UpperCamelCase_							(			self     ):
									_lowercase									=				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, is_vision_available


A		:   int         =    {'''configuration_vilt''': ['''VILT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''ViltConfig''']}

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

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A		:   Tuple         =    [
		    '''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		:   Dict         =    _LazyModule(__name__, globals()['''__file__'''], _import_structure)