



"""simple docstring"""




from collections import namedtuple

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

SCREAMING_SNAKE_CASE_:Any					=						{
    """cubicmeter""": from_to(1, 1),
    """litre""": from_to(0.001, 1_000),
    """kilolitre""": from_to(1, 1),
    """gallon""": from_to(0.00_454, 264.172),
    """cubicyard""": from_to(0.76_455, 1.30_795),
    """cubicfoot""": from_to(0.028, 35.3_147),
    """cup""": from_to(0.000_236_588, 4_226.75),
}




def      __UpperCamelCase     (  _lowerCAmelCase				,					_lowerCAmelCase				,					_lowerCAmelCase		)	->  float:



    """simple docstring"""






    if from_type not in METRIC_CONVERSION:
        raise ValueError(
            f'''Invalid \'from_type\' value: {from_type!r}  Supported values are:\n'''
            + """, """.join(_UpperCAmelCase		)		)
    if to_type not in METRIC_CONVERSION:
        raise ValueError(
            f'''Invalid \'to_type\' value: {to_type!r}.  Supported values are:\n'''
            + """, """.join(_UpperCAmelCase		)		)
    return value * METRIC_CONVERSION[from_type].from_ * METRIC_CONVERSION[to_type].to


if __name__ == "__main__":
     import doctest

     doctest.testmod()







from collections import defaultdict

from graphs.minimum_spanning_tree_prims import prisms_algorithm as mst




def      __UpperCamelCase     (  )	->  Tuple:



    """simple docstring"""






    A					,							A			:	Tuple										=       9, 14  # noqa: F841
    A			:	Optional[int]										=       [
        [0, 1, 4],
        [0, 7, 8],
        [1, 2, 8],
        [7, 8, 7],
        [7, 6, 1],
        [2, 8, 2],
        [8, 6, 6],
        [2, 3, 7],
        [2, 5, 4],
        [6, 5, 2],
        [3, 5, 14],
        [3, 4, 9],
        [5, 4, 10],
        [1, 7, 11],
    ]

    A			:	int										=       defaultdict(_lowerCAmelCase		)
    for nodea, nodea, cost in edges:
        adjancency[nodea].append([nodea, cost]		)
        adjancency[nodea].append([nodea, cost]		)

    A			:	List[str]										=       mst(_lowerCAmelCase		)

    A			:	str										=       [
        [7, 6, 1],
        [2, 8, 2],
        [6, 5, 2],
        [0, 1, 4],
        [2, 5, 4],
        [2, 3, 7],
        [0, 7, 8],
        [3, 4, 9],
    ]

    for answer in expected:
        A			:	Dict										=       tuple(answer[:2]		)
        A			:	List[str]										=       tuple(edge[::-1]		)
        assert edge in result or reverse in result


