



'''simple docstring'''






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

from .logging import get_logger


lowerCamelCase__	  =		set()
lowerCamelCase__	  =		get_logger(__name__)





def 				_SCREAMING_SNAKE_CASE(					snake_case_    :     Optional[str] = None  )		->Any:






							'''simple docstring'''

							def decorator(snake_case_    :     Callable  ):
														global _emitted_deprecation_warnings

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

														_lowercase							:		List[str]				=   (
														    F"{name} is deprecated and will be removed in the next major version of datasets." + F" {help_message}"
														    if help_message
														    else ''''''
														)

														@wraps(snake_case_  )
														def wrapper(*snake_case_    :     List[str] ,       **snake_case_    :     Optional[Any]  ):
																					_lowercase							:		Tuple				=   hash(snake_case_  )
																					if func_hash not in _emitted_deprecation_warnings:
																												warnings.warn(snake_case_ ,       category=snake_case_ ,       stacklevel=2  )
																												_emitted_deprecation_warnings.add(snake_case_  )
																					return deprecated_function(*snake_case_ ,       **snake_case_  )

														_lowercase							:		Dict				=   '''deprecated'''

														if inspect.isclass(snake_case_  ):
																					_lowercase							:		List[str]				=   wrapper
																					return deprecated_class_or_function
														else:
																					return wrapper

							return decorator

class 	_lowerCAmelCase     (    enum.EnumMeta       ):






		'''simple docstring'''
		def __getattribute__(						cls							:       Optional[int]      ,		UpperCamelCase_							:       Tuple		)      ->			Dict:







									'''simple docstring'''





									_lowercase							:		Optional[int]				=   super().__getattribute__(UpperCamelCase_		)
									if isinstance(UpperCamelCase_      ,		enum.Enum		) and obj._on_access:
																obj._on_access()
									return obj
		def __getitem__(						cls							:       Dict      ,		UpperCamelCase_							:       str		)      ->			Any:







									'''simple docstring'''





									_lowercase							:		str				=   super().__getitem__(UpperCamelCase_		)
									if member._on_access:
																member._on_access()
									return member





		def __call__(						cls							:       Tuple      ,		UpperCamelCase_							:       List[str]      ,		UpperCamelCase_							:       Optional[Any]=None      ,		*, UpperCamelCase_							:       List[Any]=None      ,		UpperCamelCase_							:       List[Any]=None      ,		UpperCamelCase_							:       int=None      ,		UpperCamelCase_							:       Union[str, Any]=1		)      ->			str:







									'''simple docstring'''





									_lowercase							:		Tuple				=   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 	_lowerCAmelCase     (    enum.Enum     ,		metaclass=__A       ):






		'''simple docstring'''
		def __new__(						cls							:       int      ,		UpperCamelCase_							:       int		)      ->			Dict:







									'''simple docstring'''





									_lowercase							:		List[str]				=   object.__new__(cls		)
									_lowercase							:		List[str]				=   value
									_lowercase							:		Union[str, Any]				=   member.deprecate
									return member
		@property
		def 						__lowercase      (						self							:       Tuple		)      ->			Any:







									'''simple docstring'''





									return ""





		def 						__lowercase      (						self							:       str		)      ->			Any:







									'''simple docstring'''





									_lowercase							:		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'''






import warnings

from .generation import GenerationMixin

class 	_lowerCAmelCase     (    __A       ):






		'''simple docstring'''
		# warning at import time
		warnings.warn(
		    'Importing `GenerationMixin` from `src/transformers/generation_utils.py` is deprecated and will '
		    'be removed in Transformers v5. Import as `from transformers import GenerationMixin` instead.'     ,		__A     ,		)



