def remove_umis(adj_list, cluster, nodes):
    """
    Removes the specified nodes from the cluster and returns
    the remaining nodes
    """
    # list incomprehension: for x in nodes: for node in adj_list[x]: yield node
    nodes_to_remove = set([node for x in nodes for node in adj_list[x]] + nodes)
    return cluster - nodes_to_remove