def get_close_edges(edges, nids_close):
    """this seems like it could be a lot faster"""
    close_edges = []
    for edge in edges:
        n1, n2 = edge
        if n1 not in nids_close and n2 not in nids_close:
            continue
        close_edges.append(edge)
    return close_edges
