def _collapse_edge_by_namespace(graph: BELGraph,<EOL>victim_namespaces: Strings,<EOL>survivor_namespaces: str,<EOL>relations: Strings) -> None:
relation_filter = build_relation_predicate(relations)<EOL>source_namespace_filter = build_source_namespace_filter(victim_namespaces)<EOL>target_namespace_filter = build_target_namespace_filter(survivor_namespaces)<EOL>edge_predicates = [<EOL>relation_filter,<EOL>source_namespace_filter,<EOL>target_namespace_filter<EOL>]<EOL>_collapse_edge_passing_predicates(graph, edge_predicates=edge_predicates)<EOL>
Collapse pairs of nodes with the given namespaces that have the given relationship.

    :param graph: A BEL Graph
    :param victim_namespaces: The namespace(s) of the node to collapse
    :param survivor_namespaces: The namespace of the node to keep
    :param relations: The relation(s) to search