def edges_between_nodes(graph, nodes):
    """
    Return all edges in graph that connect the nodes

    :param graph:
    :param nodes:
    :return:
    """

    edge_selection = []
    for edge in graph.edges:
        if edge[0] in nodes and edge[1] in nodes:
            edge_selection.append(edge)

    return edge_selection