def build_downstream_edge_predicate(nodes: Iterable[BaseEntity]) -> EdgePredicate:
    """Build an edge predicate that passes for edges for which one of the given nodes is the subject."""
    nodes = set(nodes)

    def downstream_filter(graph: BELGraph, u: BaseEntity, v: BaseEntity, k: str) -> bool:
        """Pass for relations for which one of the given nodes is the subject."""
        return u in nodes and graph[u][v][k][RELATION] in CAUSAL_RELATIONS

    return downstream_filter
Build an edge predicate that passes for edges for which one of the given nodes is the subject.