def get_undirected_edges_between(edge_data_with_info, user_ids_1, user_ids_2):
    """

    Given a pandas dataframe containing the
    edges associated with a (perhaps) directed
    graph and two sets of users
    returns the set of edges of the
    equivalent undirected graph.

    Parameters
    ------------

    edge_data_with_info : pandas dataframe

    user_ids_1 : list

    list of user ids for the first group

    user_ids_2 : list

    list of user ids for the second group


    Returns
    ----------

    shared_pairs : list

    List of tuples assoicated with the
    edges in the network.

    edges_12 : list

    List of tuples for edges from block
    1 to block 2

    edges_21 : list

    List of tuples for edges from block
    2 to block 1

    """

    edges_12 = edge_data_with_info.loc[
        (edge_data_with_info['id_1'].isin(user_ids_1)) &
        (edge_data_with_info['id_2'].isin(user_ids_2))]
    id_pairs_12 = [(i, j) for i, j in zip(list(edges_12['id_1']), list(edges_12['id_2']))]
    edges_21 = edge_data_with_info.loc[
        (edge_data_with_info['id_1'].isin(user_ids_2)) &
        (edge_data_with_info['id_2'].isin(user_ids_1))]
    id_pairs_21 = [(j, i) for i, j in zip(list(edges_21['id_1']), list(edges_21['id_2']))]

    shared_pairs = id_pairs_12
    for pair in id_pairs_21:
        if pair not in shared_pairs:
            shared_pairs.append(pair)

    return id_pairs_12, id_pairs_21, shared_pairs