





"""simple docstring"""




from __future__ import annotations






def       _SCREAMING_SNAKE_CASE		(	_lowercase						:    list[float]    ,       _lowercase						:    Tuple					) ->Union[str, Any]:






	'''simple docstring'''






	print(F"""Vertex\tShortest Distance from vertex {src}"""					)
	for i, d in enumerate(_lowercase					):
		print(F"""{i}\t\t{d}"""					)






def       _SCREAMING_SNAKE_CASE		(	_lowercase						:    list[dict[str, int]]    ,       _lowercase						:    list[float]    ,       _lowercase						:    int					) ->int:






	'''simple docstring'''






	for j in range(_lowercase					):
		a,       a,       a      :		Union[str, Any]	=				(graph[j][k] for k in ["src", "dst", "weight"])
		if distance[u] != float("inf"					) and distance[u] + w < distance[v]:
			return True
	return False






def       _SCREAMING_SNAKE_CASE		(	_lowercase						:    list[dict[str, int]]    ,       _lowercase						:    int    ,       _lowercase						:    int    ,       _lowercase						:    int					) ->list[float]:






	'''simple docstring'''






	a      :		Tuple	=				[float("inf"					)] * vertex_count
	a      :		List[Any]	=				0.0

	for _ in range(vertex_count - 1					):
		for j in range(_lowercase					):
			a,       a,       a      :		Union[str, Any]	=				(graph[j][k] for k in ["src", "dst", "weight"])

			if distance[u] != float("inf"					) and distance[u] + w < distance[v]:
				a      :		List[Any]	=				distance[u] + w

	a      :		Optional[Any]	=				check_negative_cycle(_lowercase    ,       _lowercase    ,       _lowercase					)
	if negative_cycle_exists:
		raise Exception("Negative cycle found"					)

	return distance


if __name__ == "__main__":
		import doctest

		doctest.testmod()

		a						: int     	=			int(input('''Enter number of vertices: ''').strip())
		a						: Optional[Any]     	=			int(input('''Enter number of edges: ''').strip())

		a						: list[dict[str, int]]     	=			[{} for _ in range(E)]

		for i in range(E):
				print('''Edge ''', i + 1)
				a	, a	, a						: Optional[Any]     	=			(
				    int(x)
				    for x in input('''Enter source, destination, weight: ''').strip().split(''' ''')
				)
				a						: int     	=			{'''src''': src, '''dst''': dest, '''weight''': weight}

		a						: Union[str, Any]     	=			int(input('''\nEnter shortest path source:''').strip())
		a						: Dict     	=			bellman_ford(graph, V, E, source)
		print_distance(shortest_distance, 0)









"""simple docstring"""




from unittest.mock import Mock, patch

from file_transfer.send_file import send_file






@patch("socket.socket"					)
@patch("builtins.open"					)
def       _SCREAMING_SNAKE_CASE		(	_lowercase						:    List[Any]    ,       _lowercase						:    int					) ->str:






	'''simple docstring'''






	a      :		Optional[Any]	=				Mock()
	a      :		Dict	=				conn, Mock()
	a      :		Union[str, Any]	=				iter([1, None]					)
	a      :		Optional[int]	=				lambda _lowercase					: next(_lowercase					)

	# ===== invoke =====
	send_file(filename="mytext.txt"    ,       testing=_lowercase					)

	# ===== ensurance =====
	sock.assert_called_once()
	sock.return_value.bind.assert_called_once()
	sock.return_value.listen.assert_called_once()
	sock.return_value.accept.assert_called_once()
	conn.recv.assert_called_once()

	file.return_value.__enter__.assert_called_once()
	file.return_value.__enter__.return_value.read.assert_called()

	conn.send.assert_called_once()
	conn.close.assert_called_once()
	sock.return_value.shutdown.assert_called_once()
	sock.return_value.close.assert_called_once()


