code: 
  '''simple docstring'''
  
  import enum
  import inspect
  import warnings
  from functools import wraps
  from typing import Callable, Optional
  
  from .logging import get_logger
  
  
  _UpperCAmelCase   :      Optional[Any] 						=  set()
  _UpperCAmelCase   :      Union[str, Any] 						=  get_logger(__name__)
  
  
  
  
  
  
  
  def 						snake_case__	(      UpperCamelCase = None	) ->      Dict:
  
  		def decorator(UpperCamelCase	):
  				global _emitted_deprecation_warnings
  
  				if inspect.isclass(UpperCamelCase	):
  						_UpperCamelCase       : Optional[Any]    =      deprecated_class_or_function.__init__
  						_UpperCamelCase       : List[str]    =      deprecated_class_or_function.__name__
  				else:
  						_UpperCamelCase       : Optional[Any]    =      deprecated_class_or_function
  						_UpperCamelCase       : Any    =      deprecated_function.__name__
  						# Support deprecating __init__ class method: class name instead
  						_UpperCamelCase       : List[str]    =      name if name != '''__init__''' else deprecated_function.__qualname__.split('''.'''	)[-2]
  
  				_UpperCamelCase       : Union[str, Any]    =      (
  				    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	):
  						_UpperCamelCase       : Optional[int]    =      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	)
  
  				_UpperCamelCase       : List[Any]    =      '''deprecated'''
  
  				if inspect.isclass(UpperCamelCase	):
  						_UpperCamelCase       : Optional[int]    =      wrapper
  						return deprecated_class_or_function
  				else:
  						return wrapper
  
  		return decorator
  
  class 			UpperCAmelCase				(					enum.EnumMeta ):
  
  
  
  
  
  		"""simple docstring"""
  
  
  
  
  
  		def __getattribute__(    cls  ,					_snake_case     )				->    Tuple:
  				_UpperCamelCase       : Optional[Any]    =      super().__getattribute__(_snake_case     )
  				if isinstance(_snake_case  ,					enum.Enum     ) and obj._on_access:
  						obj._on_access()
  				return obj
  		def __getitem__(    cls  ,					_snake_case     )				->    Optional[Any]:
  				_UpperCamelCase       : Union[str, Any]    =      super().__getitem__(_snake_case     )
  				if member._on_access:
  						member._on_access()
  				return member
  
  
  
  
  		def __call__(    cls  ,					_snake_case  ,					_snake_case=None  ,					*, _snake_case=None  ,					_snake_case=None  ,					_snake_case=None  ,					_snake_case=1     )				->    str:
  				_UpperCamelCase       : Tuple    =      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 			UpperCAmelCase				(					enum.Enum  ,		metaclass=a_ ):
  
  
  
  
  
  		"""simple docstring"""
  
  
  
  
  
  		def __new__(    cls  ,					_snake_case     )				->    List[Any]:
  				_UpperCamelCase       : Tuple    =      object.__new__(cls     )
  				_UpperCamelCase       : Any    =      value
  				_UpperCamelCase       : str    =      member.deprecate
  				return member
  		@property
  		def _lowercase  (    self     )				->    Optional[Any]:
  				return ""
  
  
  
  
  		def _lowercase  (    self     )				->    List[Any]:
  				_UpperCamelCase       : int    =      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  ,					)
  
  
  
  
  
  
style_context: 
  '''simple docstring'''
  
  from __future__ import annotations
  
  from collections.abc import Iterable
  from dataclasses import dataclass
  from typing import Any
  
  class 			UpperCAmelCase				:
  
  
  
  
  
  		"""simple docstring"""
  
  
  
  
  
  		A__  :   List[str]          =    ('_front', '_back', '_len')
  
  		@dataclass
  		class 			UpperCAmelCase				:
  
  
  
  
  
  				"""simple docstring"""
  
  
  
  
  
  				A__  :   Any          =    None
  				A__  :   Deque._Node | None          =    None
  				A__  :   Deque._Node | None          =    None
  
  
  
  
  
  
  
  		class 			UpperCAmelCase				:
  
  
  
  
  
  				"""simple docstring"""
  
  
  
  
  
  				A__  :   Any          =    ('_cur',)
  				def __init__(    self  ,					_snake_case     )				->    None:
  						_UpperCamelCase       : Any    =      cur
  				def __iter__(    self     )				->    Deque._Iterator:
  						return self
  
  
  
  
  				def _lowercase  (    self     )				->    Any:
  						if self._cur is None:
  								# finished iterating
  								raise StopIteration
  						_UpperCamelCase       : List[Any]    =      self._cur.val
  						_UpperCamelCase       : List[Any]    =      self._cur.next_node
  
  						return val
  
  
  
  
  
  
  
  		def __init__(    self  ,					_snake_case = None     )				->    None:
  				_UpperCamelCase       : Any    =      None
  				_UpperCamelCase       : Any    =      None
  				_UpperCamelCase       : int    =      0
  
  				if iterable is not None:
  						# append every value to the deque
  						for val in iterable:
  								self.append(_snake_case     )
  		def _lowercase  (    self  ,					_snake_case     )				->    None:
  				_UpperCamelCase       : List[str]    =      self._Node(_snake_case  ,					_snake_case  ,					_snake_case     )
  				if self.is_empty():
  						# front = back
  						_UpperCamelCase       : Union[str, Any]    =      node
  						_UpperCamelCase       : Tuple    =      1
  				else:
  						# connect nodes
  						_UpperCamelCase       : Union[str, Any]    =      node
  						_UpperCamelCase       : int    =      self._back
  						_UpperCamelCase       : List[Any]    =      node  # assign new back to the new node
  
  						self._len += 1
  
  						# make sure there were no errors
  						assert not self.is_empty(), "Error on appending value."
  		def _lowercase  (    self  ,					_snake_case     )				->    None:
  				_UpperCamelCase       : Optional[Any]    =      self._Node(_snake_case  ,					_snake_case  ,					_snake_case     )
  				if self.is_empty():
  						# front = back
  						_UpperCamelCase       : Union[str, Any]    =      node
  						_UpperCamelCase       : Optional[int]    =      1
  				else:
  						# connect nodes
  						_UpperCamelCase       : Tuple    =      self._front
  						_UpperCamelCase       : Optional[int]    =      node
  						_UpperCamelCase       : List[str]    =      node  # assign new front to the new node
  
  						self._len += 1
  
  						# make sure there were no errors
  						assert not self.is_empty(), "Error on appending value."
  		def _lowercase  (    self  ,					_snake_case     )				->    None:
  				for val in iterable:
  						self.append(_snake_case     )
  		def _lowercase  (    self  ,					_snake_case     )				->    None:
  				for val in iterable:
  						self.appendleft(_snake_case     )
  		def _lowercase  (    self     )				->    Any:
  				assert not self.is_empty(), "Deque is empty."
  
  				_UpperCamelCase       : int    =      self._back
  				_UpperCamelCase       : List[Any]    =      self._back.prev_node  # set new back
  				# drop the last node - python will deallocate memory automatically
  				_UpperCamelCase       : Union[str, Any]    =      None
  
  				self._len -= 1
  
  				return topop.val
  		def _lowercase  (    self     )				->    Any:
  				assert not self.is_empty(), "Deque is empty."
  
  				_UpperCamelCase       : List[Any]    =      self._front
  				_UpperCamelCase       : str    =      self._front.next_node  # set new front and drop the first node
  				_UpperCamelCase       : Union[str, Any]    =      None
  
  				self._len -= 1
  
  				return topop.val
  		def _lowercase  (    self     )				->    bool:
  				return self._front is None
  		def __len__(    self     )				->    int:
  				return self._len
  		def __eq__(    self  ,					_snake_case     )				->    bool:
  
  				if not isinstance(_snake_case  ,					_snake_case     ):
  						return NotImplemented
  
  				_UpperCamelCase       : Optional[int]    =      self._front
  				_UpperCamelCase       : List[Any]    =      other._front
  
  				# if the length of the dequeues are not the same, they are not equal
  				if len(self     ) != len(_snake_case     ):
  						return False
  
  				while me is not None and oth is not None:
  						# compare every value
  						if me.val != oth.val:
  								return False
  						_UpperCamelCase       : str    =      me.next_node
  						_UpperCamelCase       : List[str]    =      oth.next_node
  
  				return True
  		def __iter__(    self     )				->    Deque._Iterator:
  				return Deque._Iterator(self._front     )
  
  
  
  
  		def __repr__(    self     )				->    str:
  				_UpperCamelCase       : str    =      []
  				_UpperCamelCase       : Tuple    =      self._front
  				while aux is not None:
  						# append the values in a list to display
  						values_list.append(aux.val     )
  						_UpperCamelCase       : List[str]    =      aux.next_node
  
  				return F'''[{', '.join(repr(_snake_case     ) for val in values_list     )}]'''
  
  
  if __name__ == "__main__":
  	import doctest
  
  	doctest.testmod()
  
  
  
  
  
  