

'''simple docstring'''




from collections import namedtuple

_a :       str       							=  namedtuple('from_to', 'from_ to')

_a :       List[Any]       							=  {
    'millimeter': 'mm',
    'centimeter': 'cm',
    'meter': 'm',
    'kilometer': 'km',
    'inch': 'in',
    'inche': 'in',  # Trailing 's' has been stripped off
    'feet': 'ft',
    'foot': 'ft',
    'yard': 'yd',
    'mile': 'mi',
}

_a :       List[Any]       							=  {
    'mm': from_to(0.001, 1_000),
    'cm': from_to(0.01, 100),
    'm': from_to(1, 1),
    'km': from_to(1_000, 0.001),
    'in': from_to(0.0254, 39.3701),
    'ft': from_to(0.3048, 3.28084),
    'yd': from_to(0.9144, 1.09361),
    'mi': from_to(1_609.34, 0.000621371),
}


def 					lowerCamelCase__						(  SCREAMING_SNAKE_CASE					:      float				,      SCREAMING_SNAKE_CASE					:      str				,      SCREAMING_SNAKE_CASE					:      str  ):
  UpperCAmelCase  							=		from_type.lower().rstrip('s'  )
  UpperCAmelCase  							=		TYPE_CONVERSION.get(_UpperCamelCase				,      _UpperCamelCase  )
  UpperCAmelCase  							=		to_type.lower().rstrip('s'  )
  UpperCAmelCase  							=		TYPE_CONVERSION.get(_UpperCamelCase				,      _UpperCamelCase  )
  if new_from not in METRIC_CONVERSION:
    UpperCAmelCase  							=		(
        f'''Invalid \'from_type\' value: {from_type!r}.\n'''
        f'''Conversion abbreviations are: {', '.join(_UpperCamelCase  )}'''
    )
    raise ValueError(_UpperCamelCase  )
  if new_to not in METRIC_CONVERSION:
    UpperCAmelCase  							=		(
        f'''Invalid \'to_type\' value: {to_type!r}.\n'''
        f'''Conversion abbreviations are: {', '.join(_UpperCamelCase  )}'''
    )
    raise ValueError(_UpperCamelCase  )
  return value * METRIC_CONVERSION[new_from].from_ * METRIC_CONVERSION[new_to].to


if __name__ == "__main__":
  import doctest

  doctest.testmod()



'''simple docstring'''




from scipy.constants import g





def      _UpperCAmelCase    (							_UpperCamelCase    :	float,   _UpperCamelCase    :	float   )	->      float:
    if mass < 0:
        # handling of negative values of mass
        raise ValueError('''The mass of a body cannot be negative'''   )
    if height < 0:
        # handling of negative values of height
        raise ValueError('''The height above the ground cannot be negative'''   )
    return mass * g * height


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

  testmod(name='potential_energy')






