






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

from .logging import get_logger


_a   			=						set()
_a   			=						get_logger(__name__)


def __A					(   __lowerCAmelCase = None			)->						Dict:





						"""simple docstring"""



						def decorator(__lowerCAmelCase			):
												global _emitted_deprecation_warnings

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

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

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

												_UpperCAmelCase             =    '''deprecated'''

												if inspect.isclass(__lowerCAmelCase			):
																		_UpperCAmelCase             =    wrapper
																		return deprecated_class_or_function
												else:
																		return wrapper

						return decorator





class __lowerCamelCase				(   enum.EnumMeta):





	"""simple docstring"""






	def __getattribute__(							cls ,					UpperCAmelCase					):
							"""simple docstring"""







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

	def __getitem__(							cls ,					UpperCAmelCase					):
							"""simple docstring"""







							_UpperCAmelCase             =    super().__getitem__(_snake_case					)
							if member._on_access:
													member._on_access()
							return member



	def __call__(							cls ,					UpperCAmelCase ,					UpperCAmelCase=None ,					*, UpperCAmelCase=None ,					UpperCAmelCase=None ,					UpperCAmelCase=None ,					UpperCAmelCase=1					):
							"""simple docstring"""







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





class __lowerCamelCase				(   enum.Enum  , metaclass=a_):





	"""simple docstring"""






	def __new__(							cls ,					UpperCAmelCase					):
							"""simple docstring"""







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

	@property
	def  UpperCamelCase					(							self					):
							"""simple docstring"""







							return ""



	def  UpperCamelCase					(							self					):
							"""simple docstring"""







							_UpperCAmelCase             =    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 ,					_snake_case ,					stacklevel=3 ,					)








from typing import Any





class __lowerCamelCase				:





	"""simple docstring"""






	def __init__(							self					):
							"""simple docstring"""







							_UpperCAmelCase             =    []
							_UpperCAmelCase             =    0

	def __str__(							self					):
							"""simple docstring"""







							_UpperCAmelCase             =    '<' + str(self.stack					)[1:-1] + '>'
							return printed

	def  UpperCamelCase					(							self ,					UpperCAmelCase					):
							"""simple docstring"""







							self.stack.append(UpperCAmelCase					)
							_UpperCAmelCase             =    self.length + 1

	def  UpperCamelCase					(							self					):
							"""simple docstring"""







							self.rotate(1					)
							_UpperCAmelCase             =    self.stack[self.length - 1]
							_UpperCAmelCase             =    self.stack[:-1]
							self.rotate(self.length - 1					)
							_UpperCAmelCase             =    self.length - 1
							return dequeued

	def  UpperCamelCase					(							self ,					UpperCAmelCase					):
							"""simple docstring"""







							for _ in range(UpperCAmelCase					):
													_UpperCAmelCase             =    self.stack[0]
													_UpperCAmelCase             =    self.stack[1:]
													self.put(UpperCAmelCase					)
													_UpperCAmelCase             =    self.length - 1

	def  UpperCamelCase					(							self					):
							"""simple docstring"""







							_UpperCAmelCase             =    self.get()
							self.put(UpperCAmelCase					)
							self.rotate(self.length - 1					)
							return front

	def  UpperCamelCase					(							self					):
							"""simple docstring"""







							return self.length
