


"""simple docstring"""






from collections import namedtuple

_lowerCamelCase  =	namedtuple('from_to', 'from_ to')

_lowerCamelCase  =	{
    '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',
}

_lowerCamelCase  =	{
    'mm': from_to(0.001, 1000),
    'cm': from_to(0.01, 100),
    'm': from_to(1, 1),
    'km': from_to(1000, 0.001),
    'in': from_to(0.0_254, 39.3_701),
    'ft': from_to(0.3_048, 3.28_084),
    'yd': from_to(0.9_144, 1.09_361),
    'mi': from_to(1_609.34, 0.000_621_371),
}


def __lowercase  (   lowerCamelCase_	:   float    ,       lowerCamelCase_	:   str    ,       lowerCamelCase_	:   str	):
				SCREAMING_SNAKE_CASE__  				=					from_type.lower().rstrip("s"	)
				SCREAMING_SNAKE_CASE__  				=					TYPE_CONVERSION.get(lowerCamelCase_    ,       lowerCamelCase_	)
				SCREAMING_SNAKE_CASE__  				=					to_type.lower().rstrip("s"	)
				SCREAMING_SNAKE_CASE__  				=					TYPE_CONVERSION.get(lowerCamelCase_    ,       lowerCamelCase_	)
				if new_from not in METRIC_CONVERSION:
								SCREAMING_SNAKE_CASE__  				=					(
								    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:
								SCREAMING_SNAKE_CASE__  				=					(
								    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()




"""simple docstring"""






def __lowercase  (   lowerCamelCase_	:   str	):
				SCREAMING_SNAKE_CASE__  				=					str(lowerCamelCase_	).strip()
				if not oct_string:
								raise ValueError("Empty string was passed to the function"	)
				SCREAMING_SNAKE_CASE__  				=					oct_string[0] == "-"
				if is_negative:
								SCREAMING_SNAKE_CASE__  				=					oct_string[1:]
				if not oct_string.isdigit() or not all(0 <= int(lowerCamelCase_	) <= 7 for char in oct_string	):
								raise ValueError("Non-octal value was passed to the function"	)
				SCREAMING_SNAKE_CASE__  				=					0
				for char in oct_string:
								SCREAMING_SNAKE_CASE__  				=					8 * decimal_number + int(lowerCamelCase_	)
				if is_negative:
								SCREAMING_SNAKE_CASE__  				=					-decimal_number
				return decimal_number


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

	testmod()
