
from unittest.mock import Mock, patch

from file_transfer.send_file import send_file





@patch("socket.socket"							)
@patch("builtins.open"							)
def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase    ,		__lowerCAmelCase							):
    # ===== initialization =====
    snake_case__						=				Mock()
    snake_case__						=				conn, Mock()
    snake_case__						=				iter([1, None]							)
    snake_case__						=				lambda __lowerCAmelCase							: next(__lowerCAmelCase							)

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

    # ===== 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()





# A Bipartite Graph is a graph whose vertices can be divided into two independent sets,
# U and V such that every edge (u, v) either connects a vertex from U to V or a vertex
# from V to U. In other words, for every edge (u, v), either u belongs to U and v to V,
# or u belongs to V and v to U. We can also say that there is no edge that connects
# vertices of same set.





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase							):
    snake_case__						=				[False] * len(__lowerCAmelCase							)
    snake_case__						=				[-1] * len(__lowerCAmelCase							)

    def dfs(__lowerCAmelCase    ,		__lowerCAmelCase							):
        snake_case__						=				True
        snake_case__						=				c
        for u in graph[v]:
            if not visited[u]:
                dfs(__lowerCAmelCase    ,		1 - c							)

    for i in range(len(__lowerCAmelCase							)							):
        if not visited[i]:
            dfs(__lowerCAmelCase    ,		0							)

    for i in range(len(__lowerCAmelCase							)							):
        for j in graph[i]:
            if color[i] == color[j]:
                return False

    return True


# Adjacency list of graph
__magic_name__            =  {0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: []}





print(check_bipartite_dfs(graph))



