def remove_isolated_nodes(net):
    """
    Removes nodes with no edges from network.

    It modifies the provided graph inplace.

    Parameters
    ----------
    net : nx.DiGraph

    """
    to_remove = set()
    for i in net.nodes:
        if len(list(net.predecessors(i))) == 0 and len(list(net.successors(i))
            ) == 0:
            to_remove.add(i)
    net.remove_nodes_from(to_remove)
