import copy


def identify_all_failure_paths(network_df_in,edge_failure_set,flow_dataframe,path_criteria):
    """Identify all paths that contain an edge

    Parameters
    ---------
    network_df_in - Pandas DataFrame of network
    edge_failure_set - List of string edge ID's
    flow_dataframe - Pandas DataFrame of list of edge paths
    path_criteria - String name of column of edge paths in flow dataframe

    Outputs
    -------
    network_df - Pandas DataFrame of network
        With removed edges
    edge_path_index - List of integer indexes
        Of locations of paths in flow dataframe
    """

    edge_path_index = []
    network_df = copy.deepcopy(network_df_in)
    for edge in edge_failure_set:
        network_df = network_df[network_df.edge_id != edge]
        edge_path_index += flow_dataframe.loc[flow_dataframe[path_criteria].str.contains(
            "'{}'".format(edge))].index.tolist()

    edge_path_index = list(set(edge_path_index))
    return network_df, edge_path_index