





import numpy as np

UpperCAmelCase_					:   List[Any] 							=						[
    ["""a""", """b""", """c""", """d""", """e"""],
    ["""f""", """g""", """h""", """i""", """k"""],
    ["""l""", """m""", """n""", """o""", """p"""],
    ["""q""", """r""", """s""", """t""", """u"""],
    ["""v""", """w""", """x""", """y""", """z"""],
]





class      lowercase__    :







  def __init__(	self						):
       lowerCAmelCase_					:       Dict    =		np.array(_lowercase						)







  def 	UpperCAmelCase__		(	self    ,						_lowercase						):
       lowerCAmelCase_   ,  lowerCAmelCase_					:       Tuple    =		np.where(letter == self.SQUARE						)
       lowerCAmelCase_					:       Any    =		np.concatenate([indexa + 1, indexa + 1]						)
       return indexes







  def 	UpperCAmelCase__		(	self    ,						_lowercase    ,						_lowercase						):
       lowerCAmelCase_					:       List[Any]    =		self.SQUARE[indexa - 1, indexa - 1]
       return letter







  def 	UpperCAmelCase__		(	self    ,						_lowercase						):
       lowerCAmelCase_					:       List[str]    =		message.lower()
       lowerCAmelCase_					:       Any    =		message.replace(""" """    ,						""""""						)
       lowerCAmelCase_					:       Union[str, Any]    =		message.replace("""j"""    ,						"""i"""						)

       lowerCAmelCase_					:       Dict    =		np.empty((2, len(_lowercase						))						)
       for letter_index in range(len(_lowercase						)						):
            lowerCAmelCase_					:       Optional[int]    =		self.letter_to_numbers(message[letter_index]						)

            lowerCAmelCase_					:       List[str]    =		numbers[0]
            lowerCAmelCase_					:       Optional[int]    =		numbers[1]

       lowerCAmelCase_					:       List[str]    =		first_step.reshape(2 * len(_lowercase						)						)
       lowerCAmelCase_					:       List[Any]    =		""""""
       for numbers_index in range(len(_lowercase						)						):
            lowerCAmelCase_					:       List[str]    =		int(second_step[numbers_index * 2]						)
            lowerCAmelCase_					:       Dict    =		int(second_step[(numbers_index * 2) + 1]						)
            lowerCAmelCase_					:       Tuple    =		self.numbers_to_letter(_lowercase    ,						_lowercase						)
            lowerCAmelCase_					:       Dict    =		encoded_message + letter

       return encoded_message







  def 	UpperCAmelCase__		(	self    ,						_lowercase						):
       lowerCAmelCase_					:       str    =		message.lower()
       message.replace(""" """    ,						""""""						)
       lowerCAmelCase_					:       Optional[int]    =		np.empty(2 * len(_lowercase						)						)
       for letter_index in range(len(_lowercase						)						):
            lowerCAmelCase_					:       Optional[int]    =		self.letter_to_numbers(message[letter_index]						)
            lowerCAmelCase_					:       List[Any]    =		numbers[0]
            lowerCAmelCase_					:       List[Any]    =		numbers[1]

       lowerCAmelCase_					:       Dict    =		first_step.reshape((2, len(_lowercase						))						)
       lowerCAmelCase_					:       Any    =		""""""
       for numbers_index in range(len(_lowercase						)						):
            lowerCAmelCase_					:       Optional[int]    =		int(second_step[0, numbers_index]						)
            lowerCAmelCase_					:       Any    =		int(second_step[1, numbers_index]						)
            lowerCAmelCase_					:       Optional[Any]    =		self.numbers_to_letter(_lowercase    ,						_lowercase						)
            lowerCAmelCase_					:       List[Any]    =		decoded_message + letter

       return decoded_message







from collections import namedtuple

UpperCAmelCase_					:   Union[str, Any] 							=						namedtuple("""from_to""", """from_ to""")

UpperCAmelCase_					:   int 							=						{
    """cubicmeter""": from_to(1, 1),
    """litre""": from_to(0.0_01, 10_00),
    """kilolitre""": from_to(1, 1),
    """gallon""": from_to(0.0_04_54, 2_64.1_72),
    """cubicyard""": from_to(0.7_64_55, 1.3_07_95),
    """cubicfoot""": from_to(0.0_28, 35.31_47),
    """cup""": from_to(0.0_00_23_65_88, 42_26.75),
}






def 							_lowerCAmelCase (  _a   :					float					,   _a   :					str					,   _a   :					str			)	->			float:
     if from_type not in METRIC_CONVERSION:
          raise ValueError(
              F'Invalid \'from_type\' value: {from_type!r}  Supported values are:\n'
              + """, """.join(_a			)			)
     if to_type not in METRIC_CONVERSION:
          raise ValueError(
              F'Invalid \'to_type\' value: {to_type!r}.  Supported values are:\n'
              + """, """.join(_a			)			)
     return value * METRIC_CONVERSION[from_type].from_ * METRIC_CONVERSION[to_type].to


if __name__ == "__main__":
      import doctest

      doctest.testmod()
