def build_target_namespace_filter(namespaces: Strings) -> EdgePredicate:
if isinstance(namespaces, str):<EOL><INDENT>def target_namespace_filter(_, __, v: BaseEntity, ___) -> bool:<EOL><INDENT>return node_has_namespace(v, namespaces)<EOL><DEDENT><DEDENT>elif isinstance(namespaces, Iterable):<EOL><INDENT>namespaces = set(namespaces)<EOL>def target_namespace_filter(_, __, v: BaseEntity, ___) -> bool:<EOL><INDENT>return node_has_namespaces(v, namespaces)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise TypeError<EOL><DEDENT>return target_namespace_filter<EOL>
Only passes for edges whose target nodes have the given namespace or one of the given namespaces

    :param namespaces: The namespace or namespaces to filter by