

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 (SCREAMING_SNAKE_CASE__ = None	):

						def decorator(SCREAMING_SNAKE_CASE__	):
												global _emitted_deprecation_warnings

												if inspect.isclass(SCREAMING_SNAKE_CASE__	):
																		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(SCREAMING_SNAKE_CASE__	)
												def wrapper(*SCREAMING_SNAKE_CASE__  ,		**SCREAMING_SNAKE_CASE__	):
																		snake_case_       =     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__	)

												snake_case_       =     '''deprecated'''

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

						return decorator





class      snake_case_       (		enum.EnumMeta ):







			'''simple docstring'''

			def __getattribute__(					cls			:    Any							,       _UpperCamelCase			:    Optional[int]							)				->Union[str, Any]:
									snake_case_       =     super().__getattribute__(_UpperCamelCase							)
									if isinstance(_UpperCamelCase							,       enum.Enum							) and obj._on_access:
															obj._on_access()
									return obj







			def __getitem__(					cls			:    List[Any]							,       _UpperCamelCase			:    Tuple							)				->Union[str, Any]:
									snake_case_       =     super().__getitem__(_UpperCamelCase							)
									if member._on_access:
															member._on_access()
									return member







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







			'''simple docstring'''

			def __new__(					cls			:    Optional[int]							,       _UpperCamelCase			:    Union[str, Any]							)				->Union[str, Any]:
									snake_case_       =     object.__new__(cls							)
									snake_case_       =     value
									snake_case_       =     member.deprecate
									return member







			@property
			def     snake_case__(					self			:    List[str]							)				->Tuple:
									return ""







			def     snake_case__(					self			:    Dict							)				->Tuple:
									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							,       _UpperCamelCase							,       stacklevel=3							,       )


def   __SCREAMING_SNAKE_CASE (SCREAMING_SNAKE_CASE__	):
						snake_case_       =     5381
						for x in s:
												snake_case_       =     ((hash_value << 5) + hash_value) + ord(SCREAMING_SNAKE_CASE__	)
						return hash_value & 0xFF_FF_FF_FF