






'''simple docstring'''







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

from .logging import get_logger


_A      :     str       	=set()
_A      :     List[str]       	=get_logger(__name__)





def 					SCREAMING_SNAKE_CASE_			(UpperCamelCase = None ) ->			Tuple:

							def decorator(UpperCamelCase ):
														global _emitted_deprecation_warnings

														if inspect.isclass(UpperCamelCase ):
																					lowerCamelCase__   :      Tuple			    =			deprecated_class_or_function.__init__
																					lowerCamelCase__   :      List[str]			    =			deprecated_class_or_function.__name__
														else:
																					lowerCamelCase__   :      Tuple			    =			deprecated_class_or_function
																					lowerCamelCase__   :      str			    =			deprecated_function.__name__
																					# Support deprecating __init__ class method: class name instead
																					lowerCamelCase__   :      int			    =			name if name != """__init__""" else deprecated_function.__qualname__.split(""".""" )[-2]

														lowerCamelCase__   :      Tuple			    =			(
														    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 ):
																					lowerCamelCase__   :      Dict			    =			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 )

														lowerCamelCase__   :      Optional[Any]			    =			"""deprecated"""

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

							return decorator

class _lowercase      (							enum.EnumMeta						):




							def __getattribute__(				cls:							Any     ,				UpperCamelCase__:							Dict	):
														lowerCamelCase__   :      List[Any]			    =			super().__getattribute__(UpperCamelCase__	)
														if isinstance(UpperCamelCase__     ,				enum.Enum	) and obj._on_access:
																					obj._on_access()
														return obj




							def __getitem__(				cls:							Dict     ,				UpperCamelCase__:							List[str]	):
														lowerCamelCase__   :      Tuple			    =			super().__getitem__(UpperCamelCase__	)
														if member._on_access:
																					member._on_access()
														return member




							def __call__(				cls:							Dict     ,				UpperCamelCase__:							List[Any]     ,				UpperCamelCase__:							Union[str, Any]=None     ,				*, UpperCamelCase__:							Optional[Any]=None     ,				UpperCamelCase__:							Optional[Any]=None     ,				UpperCamelCase__:							Optional[int]=None     ,				UpperCamelCase__:							Optional[Any]=1	):
														lowerCamelCase__   :      int			    =			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 _lowercase      (							enum.Enum							, metaclass=_lowercase						):




							def __new__(				cls:							str     ,				UpperCamelCase__:							List[str]	):
														lowerCamelCase__   :      Optional[int]			    =			object.__new__(cls	)
														lowerCamelCase__   :      List[str]			    =			value
														lowerCamelCase__   :      Optional[Any]			    =			member.deprecate
														return member




							@property
							def 						lowerCamelCase_							(				self:							Any	):
														return ""




							def 						lowerCamelCase_							(				self:							List[str]	):
														lowerCamelCase__   :      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     ,				UpperCamelCase__     ,				stacklevel=3     ,				)









'''simple docstring'''







from typing import TYPE_CHECKING

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


_A      :     Optional[Any]       	={
    '''configuration_realm''': ['''REALM_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''RealmConfig'''],
    '''tokenization_realm''': ['''RealmTokenizer'''],
}

try:
			if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_A      :     str       	=['''RealmTokenizerFast''']

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_A      :     List[Any]       	=[
			    '''REALM_PRETRAINED_MODEL_ARCHIVE_LIST''',
			    '''RealmEmbedder''',
			    '''RealmForOpenQA''',
			    '''RealmKnowledgeAugEncoder''',
			    '''RealmPreTrainedModel''',
			    '''RealmReader''',
			    '''RealmScorer''',
			    '''load_tf_weights_in_realm''',
			]
			_A      :     Union[str, Any]       	=['''RealmRetriever''']


if TYPE_CHECKING:
			from .configuration_realm import REALM_PRETRAINED_CONFIG_ARCHIVE_MAP, RealmConfig
			from .tokenization_realm import RealmTokenizer

			try:
						if not is_tokenizers_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .tokenization_realm import RealmTokenizerFast

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_realm import (
						    REALM_PRETRAINED_MODEL_ARCHIVE_LIST,
						    RealmEmbedder,
						    RealmForOpenQA,
						    RealmKnowledgeAugEncoder,
						    RealmPreTrainedModel,
						    RealmReader,
						    RealmScorer,
						    load_tf_weights_in_realm,
						)
						from .retrieval_realm import RealmRetriever


else:
			import sys

			_A      :     int       	=_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)

