


from collections import namedtuple

__UpperCamelCase					:	Union[str, Any]          =				namedtuple('from_to', 'from_ to')

__UpperCamelCase					:	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',
}

__UpperCamelCase					:	int          =				{
    '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   snake_case_    (			__lowercase      ,							__lowercase      ,							__lowercase							):
   UpperCAmelCase_				:   Optional[Any]							= from_type.lower().rstrip('''s'''							)
   UpperCAmelCase_				:   Dict							= TYPE_CONVERSION.get(__lowercase      ,							__lowercase							)
   UpperCAmelCase_				:   Dict							= to_type.lower().rstrip('''s'''							)
   UpperCAmelCase_				:   List[str]							= TYPE_CONVERSION.get(__lowercase      ,							__lowercase							)
   if new_from not in METRIC_CONVERSION:
      UpperCAmelCase_				:   List[Any]							= (
          F'''Invalid \'from_type\' value: {from_type!r}.\n'''
          F'''Conversion abbreviations are: {', '.join(__lowercase							)}'''
      )
      raise ValueError(__lowercase							)
   if new_to not in METRIC_CONVERSION:
      UpperCAmelCase_				:   List[Any]							= (
          F'''Invalid \'to_type\' value: {to_type!r}.\n'''
          F'''Conversion abbreviations are: {', '.join(__lowercase							)}'''
      )
      raise ValueError(__lowercase							)
   return value * METRIC_CONVERSION[new_from].from_ * METRIC_CONVERSION[new_to].to


if __name__ == "__main__":
       import doctest

       doctest.testmod()



def   snake_case_    (			__lowercase      ,							__lowercase      ,							__lowercase      ,							__lowercase							):
   UpperCAmelCase_				:   Optional[int]							= int((lower_bound + upper_bound) // 2							)
   if array[r] == value:
      return r
   if lower_bound >= upper_bound:
      return -1
   if array[r] < value:
      return binary_search(__lowercase      ,							r + 1      ,							__lowercase      ,							__lowercase							)
   else:
      return binary_search(__lowercase      ,							__lowercase      ,							r - 1      ,							__lowercase							)
def   snake_case_    (			__lowercase      ,							__lowercase							):
   UpperCAmelCase_				:   Union[str, Any]							= 0
   if matrix[index][0] == value:
      return [index, 0]
   while index < len(__lowercase							) and matrix[index][0] < value:
      UpperCAmelCase_				:   str							= binary_search(matrix[index]      ,							0      ,							len(matrix[index]							) - 1      ,							__lowercase							)
      if r != -1:
         return [index, r]
      index += 1
   return [-1, -1]


if __name__ == "__main__":
       import doctest

       doctest.testmod()