

'''simple docstring'''

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

from .logging import get_logger


lowercase__            =     set()
lowercase__            =     get_logger(__name__)




def  UpperCamelCase(	UpperCAmelCase_ = None      ):

 def decorator(UpperCAmelCase_      ):
  global _emitted_deprecation_warnings

  if inspect.isclass(lowercase_      ):
   UpperCAmelCase			:      List[str]		   =					deprecated_class_or_function.__init__
   UpperCAmelCase			:      Tuple		   =					deprecated_class_or_function.__name__
  else:
   UpperCAmelCase			:      Optional[int]		   =					deprecated_class_or_function
   UpperCAmelCase			:      List[str]		   =					deprecated_function.__name__
   # Support deprecating __init__ class method: class name instead
   UpperCAmelCase			:      List[Any]		   =					name if name != '__init__' else deprecated_function.__qualname__.split('.'      )[-2]

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

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

  UpperCAmelCase			:      str		   =					'deprecated'

  if inspect.isclass(lowercase_      ):
   UpperCAmelCase			:      Optional[Any]		   =					wrapper
   return deprecated_class_or_function
  else:
   return wrapper

 return decorator




class 			A_					(							enum.EnumMeta				):






     '''simple docstring'''



     def __getattribute__(						cls					:	Dict	,     lowercase_					:	str			)		->      str:
      UpperCAmelCase			:      List[Any]		   =					super().__getattribute__(lowerCAmelCase__			)
      if isinstance(lowerCAmelCase__	,     enum.Enum			) and obj._on_access:
       obj._on_access()
      return obj


     def __getitem__(						cls					:	Optional[int]	,     lowercase_					:	Optional[Any]			)		->      Dict:
      UpperCAmelCase			:      Union[str, Any]		   =					super().__getitem__(lowerCAmelCase__			)
      if member._on_access:
       member._on_access()
      return member




     def __call__(						cls					:	Dict	,     lowercase_					:	int	,     lowercase_					:	List[Any]=None	,     *, lowercase_					:	int=None	,     lowercase_					:	Dict=None	,     lowercase_					:	Tuple=None	,     lowercase_					:	Dict=1			)		->      Dict:
      UpperCAmelCase			:      Tuple		   =					super().__call__(lowerCAmelCase__	,     lowerCAmelCase__	,     module=lowerCAmelCase__	,     qualname=lowerCAmelCase__	,     type=lowerCAmelCase__	,     start=lowerCAmelCase__			)
      if isinstance(lowerCAmelCase__	,     enum.Enum			) and obj._on_access:
       obj._on_access()
      return obj




class 			A_					(							enum.Enum			,  metaclass=lowercase__				):






     '''simple docstring'''



     def __new__(						cls					:	Optional[Any]	,     lowercase_					:	Tuple			)		->      Any:
      UpperCAmelCase			:      str		   =					object.__new__(cls			)
      UpperCAmelCase			:      Optional[Any]		   =					value
      UpperCAmelCase			:      Dict		   =					member.deprecate
      return member


     @property
     def   UpperCAmelCase_			(						self					:	List[Any]			)		->      Any:
      return ""




     def   UpperCAmelCase_			(						self					:	List[Any]			)		->      List[str]:
      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	,     lowerCAmelCase__	,     stacklevel=3	,     )












from __future__ import annotations

import re





def 						A_					(						lowercase_			)				->list[str]:







 """simple docstring"""

 def alphanum_key(lowercase_			):
  return [int(lowercase_			) if s.isdigit() else s.lower() for s in re.split('([0-9]+)'	,  lowercase_			)]

 return sorted(lowercase_	,  key=lowercase_			)


if __name__ == "__main__":
      import doctest

      doctest.testmod()




