




import heapq






def  snake_case (							A						,       A						,       A      )							->							Union[str, Any]:
	lowerCamelCase_							:		Optional[int]							       =							[(0, start)]  # cost from start node,end node
	lowerCamelCase_							:		str							       =							set()
	while heap:
		(lowerCamelCase_)							:		Optional[int]							       =							heapq.heappop(SCREAMING_SNAKE_CASE_      )
		if u in visited:
			continue
		visited.add(SCREAMING_SNAKE_CASE_      )
		if u == end:
			return cost
		for v, c in graph[u]:
			if v in visited:
				continue
			lowerCamelCase_							:		int							       =							cost + c
			heapq.heappush(SCREAMING_SNAKE_CASE_						,       (next_item, v)      )
	return -1


UpperCamelCase__		=						{
    'A': [['B', 2], ['C', 5]],
    'B': [['A', 2], ['D', 3], ['E', 1], ['F', 1]],
    'C': [['A', 5], ['F', 3]],
    'D': [['B', 3]],
    'E': [['B', 4], ['F', 3]],
    'F': [['C', 3], ['E', 3]],
}
UpperCamelCase__		=						{
    'B': [['C', 1]],
    'C': [['D', 1]],
    'D': [['F', 1]],
    'E': [['B', 1], ['F', 3]],
    'F': [],
}
UpperCamelCase__		=						{
    'B': [['C', 1]],
    'C': [['D', 1]],
    'D': [['F', 1]],
    'E': [['B', 1], ['G', 2]],
    'F': [],
    'G': [['F', 1]],
}

UpperCamelCase__		=						dijkstra(G, 'E', 'C')
print(short_distance)  # E -- 3 --> F -- 3 --> C == 6

UpperCamelCase__		=						dijkstra(Ga, 'E', 'F')
print(short_distance)  # E -- 3 --> F == 3

UpperCamelCase__		=						dijkstra(Ga, 'E', 'F')
print(short_distance)  # E -- 2 --> G -- 1 --> F == 3

if __name__ == "__main__":
							import doctest

							doctest.testmod()






UpperCamelCase__		=						{
    "kilogram": 1,
    "gram": pow(1_0, 3),
    "milligram": pow(1_0, 6),
    "metric-ton": pow(1_0, -3),
    "long-ton": 0.0_009_842_073,
    "short-ton": 0.0_011_023_122,
    "pound": 2.2_046_244_202,
    "stone": 0.1_574_731_728,
    "ounce": 35.273_990_723,
    "carrat": 5_0_0_0,
    "atomic-mass-unit": 6.022136652e26,
}

UpperCamelCase__		=						{
    "kilogram": 1,
    "gram": pow(1_0, -3),
    "milligram": pow(1_0, -6),
    "metric-ton": pow(1_0, 3),
    "long-ton": 1_016.04_608,
    "short-ton": 907.184,
    "pound": 0.453_592,
    "stone": 6.35_029,
    "ounce": 0.0_283_495,
    "carrat": 0.0_002,
    "atomic-mass-unit": 1.660540199e-27,
}






def  snake_case (							A						,       A						,       A      )							->							float:




	'''simple docstring'''


	if to_type not in KILOGRAM_CHART or from_type not in WEIGHT_TYPE_CHART:
		lowerCamelCase_							:		Union[str, Any]							       =							(
		    f"Invalid 'from_type' or 'to_type' value: {from_type!r}, {to_type!r}\n"
		    f"Supported values are: {', '.join(A      )}"
		)
		raise ValueError(A      )
	return value * KILOGRAM_CHART[to_type] * WEIGHT_TYPE_CHART[from_type]


if __name__ == "__main__":
							import doctest

							doctest.testmod()
