




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

from .logging import get_logger


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


def 						lowerCamelCase__   (		_A = None							):







	'''simple docstring'''





	def decorator(_A							):
		global _emitted_deprecation_warnings

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

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

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

		snake_case_		   =					"deprecated"

		if inspect.isclass(_A							):
			snake_case_		   =					wrapper
			return deprecated_class_or_function
		else:
			return wrapper

	return decorator
class 		UpperCAmelCase       (    enum.EnumMeta      ):







						'''simple docstring'''





						def __getattribute__(						cls							:					Any	,     __lowercase							:					Optional[Any]						):






							"""simple docstring"""






							snake_case_		   =					super().__getattribute__(__lowercase						)
							if isinstance(__lowercase	,     enum.Enum						) and obj._on_access:
								obj._on_access()
							return obj






						def __getitem__(						cls							:					Union[str, Any]	,     __lowercase							:					Tuple						):






							"""simple docstring"""






							snake_case_		   =					super().__getitem__(__lowercase						)
							if member._on_access:
								member._on_access()
							return member






						def __call__(						cls							:					Dict	,     __lowercase							:					Any	,     __lowercase							:					Optional[Any]=None	,     *, __lowercase							:					Optional[int]=None	,     __lowercase							:					Tuple=None	,     __lowercase							:					Dict=None	,     __lowercase							:					Any=1						):






							"""simple docstring"""






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







class 		UpperCAmelCase       (    enum.Enum	,       metaclass=UpperCAmelCase__      ):







						'''simple docstring'''





						def __new__(						cls							:					List[Any]	,     __lowercase							:					Any						):






							"""simple docstring"""






							snake_case_		   =					object.__new__(cls						)
							snake_case_		   =					value
							snake_case_		   =					member.deprecate
							return member






						@property
						def 	snake_case__						(						self							:					Optional[Any]						):






							"""simple docstring"""






							return ""






						def 	snake_case__						(						self							:					Optional[Any]						):






							"""simple docstring"""






							snake_case_		   =					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	,     __lowercase	,     stacklevel=3	,     )






from typing import TYPE_CHECKING

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


lowercase__    :					List[str]					=						{
    "configuration_xlm_prophetnet": ["XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLMProphetNetConfig"],
}

try:
		if not is_sentencepiece_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase__    :					Optional[Any]					=						["XLMProphetNetTokenizer"]

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase__    :					List[Any]					=						[
		    "XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST",
		    "XLMProphetNetDecoder",
		    "XLMProphetNetEncoder",
		    "XLMProphetNetForCausalLM",
		    "XLMProphetNetForConditionalGeneration",
		    "XLMProphetNetModel",
		    "XLMProphetNetPreTrainedModel",
		]


if TYPE_CHECKING:
		from .configuration_xlm_prophetnet import XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMProphetNetConfig

		try:
				if not is_sentencepiece_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_xlm_prophetnet import XLMProphetNetTokenizer

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_xlm_prophetnet import (
				    XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST,
				    XLMProphetNetDecoder,
				    XLMProphetNetEncoder,
				    XLMProphetNetForCausalLM,
				    XLMProphetNetForConditionalGeneration,
				    XLMProphetNetModel,
				    XLMProphetNetPreTrainedModel,
				)

else:
		import sys

		lowercase__    :					Any					=						_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
