
from collections import namedtuple

lowercase						:      Any							=							namedtuple("""from_to""", """from_ to""")

lowercase						:      Optional[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""",
}

lowercase						:      Tuple							=							{
    """mm""": from_to(0.0_0_1, 1000),
    """cm""": from_to(0.0_1, 100),
    """m""": from_to(1, 1),
    """km""": from_to(1000, 0.0_0_1),
    """in""": from_to(0.0_2_5_4, 3_9.3_7_0_1),
    """ft""": from_to(0.3_0_4_8, 3.2_8_0_8_4),
    """yd""": from_to(0.9_1_4_4, 1.0_9_3_6_1),
    """mi""": from_to(1_6_0_9.3_4, 0.0_0_0_6_2_1_3_7_1),
}







def 		_snake_case(						SCREAMING_SNAKE_CASE__      ,			SCREAMING_SNAKE_CASE__      ,			SCREAMING_SNAKE_CASE__       )				->					float:
       lowercase							:  Optional[Any] 			=   from_type.lower().rstrip("""s"""       )
       lowercase							:  int 			=   TYPE_CONVERSION.get(lowerCamelCase__      ,			lowerCamelCase__       )
       lowercase							:  int 			=   to_type.lower().rstrip("""s"""       )
       lowercase							:  Tuple 			=   TYPE_CONVERSION.get(lowerCamelCase__      ,			lowerCamelCase__       )
       if new_from not in METRIC_CONVERSION:
              lowercase							:  List[str] 			=   (
                  f"Invalid 'from_type' value: {from_type!r}.\n"
                  f"Conversion abbreviations are: {', '.join(lowerCamelCase__       )}"
              )
              raise ValueError(lowerCamelCase__       )
       if new_to not in METRIC_CONVERSION:
              lowercase							:  str 			=   (
                  f"Invalid 'to_type' value: {to_type!r}.\n"
                  f"Conversion abbreviations are: {', '.join(lowerCamelCase__       )}"
              )
              raise ValueError(lowerCamelCase__       )
       return value * METRIC_CONVERSION[new_from].from_ * METRIC_CONVERSION[new_to].to


if __name__ == "__main__":
  import doctest

  doctest.testmod()




from __future__ import annotations







def 		_snake_case(						SCREAMING_SNAKE_CASE__       )				->					bool:
       lowercase							:  int
       lowercase							:  list[str] 			=   list(SCREAMING_SNAKE_CASE__       )
       lowercase			,    lowercase							:  Union[str, Any] 			=   _vector[:-1], int(_vector[-1]       )
       lowercase							:  list[int] 			=   [int(SCREAMING_SNAKE_CASE__       ) for digit in __vector]

       vector.reverse()
       for i, digit in enumerate(SCREAMING_SNAKE_CASE__       ):
              if i & 1 == 0:
                     lowercase							:  int 			=   digit * 2
                     if doubled > 9:
                            doubled -= 9
                     check_digit += doubled
              else:
                     check_digit += digit

       return check_digit % 10 == 0


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  assert is_luhn("""79927398713""")
  assert not is_luhn("""79927398714""")
