



'''simple docstring'''





from abc import ABC, abstractmethod
from typing import Optional, Union

from .. import Dataset, DatasetDict, Features, IterableDataset, IterableDatasetDict, NamedSplit
from ..utils.typing import NestedDataStructureLike, PathLike






class        lowerCAmelCase_(				SCREAMING_SNAKE_CASE_     ):
  '''simple docstring'''




  def __init__(    self  ,__UpperCAmelCase = None  ,__UpperCAmelCase = None  ,__UpperCAmelCase = None  ,__UpperCAmelCase = None  ,__UpperCAmelCase = False  ,__UpperCAmelCase = False  ,__UpperCAmelCase = None  ,**__UpperCAmelCase  ,)    ->		Optional[Any]:
      lowerCAmelCase__ :  str							      =					path_or_paths
      lowerCAmelCase__ :  Optional[Any]							      =					split if split or isinstance(__UpperCAmelCase  ,__UpperCAmelCase      ) else """train"""
      lowerCAmelCase__ :  int							      =					features
      lowerCAmelCase__ :  Optional[Any]							      =					cache_dir
      lowerCAmelCase__ :  Any							      =					keep_in_memory
      lowerCAmelCase__ :  Union[str, Any]							      =					streaming
      lowerCAmelCase__ :  Optional[int]							      =					num_proc
      lowerCAmelCase__ :  Tuple							      =					kwargs






  @abstractmethod
  def 							UpperCAmelCase_	(    self      )    ->		Union[Dataset, DatasetDict, IterableDataset, IterableDatasetDict]:
      pass







class        lowerCAmelCase_(				SCREAMING_SNAKE_CASE_     ):
  '''simple docstring'''




  def __init__(    self  ,__UpperCAmelCase = None  ,__UpperCAmelCase = None  ,__UpperCAmelCase = False  ,__UpperCAmelCase = False  ,__UpperCAmelCase = None  ,**__UpperCAmelCase  ,)    ->		Dict:
      lowerCAmelCase__ :  str							      =					features
      lowerCAmelCase__ :  str							      =					cache_dir
      lowerCAmelCase__ :  int							      =					keep_in_memory
      lowerCAmelCase__ :  int							      =					streaming
      lowerCAmelCase__ :  int							      =					num_proc
      lowerCAmelCase__ :  int							      =					kwargs






  @abstractmethod
  def 							UpperCAmelCase_	(    self      )    ->		Union[Dataset, IterableDataset]:
      pass










"""simple docstring"""



_UpperCamelCase		:  List[str]						=		{
    'meter': 'm',
    'kilometer': 'km',
    'megametre': 'Mm',
    'gigametre': 'Gm',
    'terametre': 'Tm',
    'petametre': 'Pm',
    'exametre': 'Em',
    'zettametre': 'Zm',
    'yottametre': 'Ym',
}
# Exponent of the factor(meter)
_UpperCamelCase		:  str						=		{
    'm': 0,
    'km': 3,
    'Mm': 6,
    'Gm': 9,
    'Tm': 1_2,
    'Pm': 1_5,
    'Em': 1_8,
    'Zm': 2_1,
    'Ym': 2_4,
}
def 						_SCREAMING_SNAKE_CASE (    __snake_case			:  float		,					__snake_case			:  str		,					__snake_case			:  str    ):





  '''simple docstring'''





  lowercase							    =       from_type.lower().strip('s'    )
  lowercase							    =       to_type.lower().strip('s'    )

  lowercase							    =       UNIT_SYMBOL.get(__snake_case		,					__snake_case    )
  lowercase							    =       UNIT_SYMBOL.get(__snake_case		,					__snake_case    )

  if from_sanitized not in METRIC_CONVERSION:
    lowercase							    =       (
        f'Invalid \'from_type\' value: {from_type!r}.\n'
        f'Conversion abbreviations are: {", ".join(__snake_case    )}'
    )
    raise ValueError(__snake_case    )
  if to_sanitized not in METRIC_CONVERSION:
    lowercase							    =       (
        f'Invalid \'to_type\' value: {to_type!r}.\n'
        f'Conversion abbreviations are: {", ".join(__snake_case    )}'
    )
    raise ValueError(__snake_case    )
  lowercase							    =       METRIC_CONVERSION[from_sanitized]
  lowercase							    =       METRIC_CONVERSION[to_sanitized]
  lowercase							    =       1

  if from_exponent > to_exponent:
    lowercase							    =       from_exponent - to_exponent
  else:
    lowercase							    =       -(to_exponent - from_exponent)

  return value * pow(10		,					__snake_case    )


if __name__ == "__main__":
    from doctest import testmod

    testmod()


