def METHOD_NAME(namespaces, ri, oc_map):
    for namespace_info in namespaces:
        namespace = namespace_info["name"]
        cluster = namespace_info["cluster"]["name"]
        if not oc_map.get(cluster):
            continue
        source_namespaces = namespace_info["networkPoliciesAllow"]
        for source_namespace_info in source_namespaces:
            source_namespace = source_namespace_info["name"]
            source_cluster = source_namespace_info["cluster"]["name"]
            if cluster != source_cluster:
                ri.register_error()
                msg = ("[{}/{}] Network Policy from cluster '{}' not allowed.").format(
                    cluster, namespace, source_cluster
                )
                logging.error(msg)
                continue
            resource_name = "allow-from-{}-namespace".format(source_namespace)
            oc_resource = construct_oc_resource(resource_name, source_namespace)
            ri.add_desired(
                cluster,
                namespace,
                "NetworkPolicy",
                resource_name,
                oc_resource,
                privileged=namespace_info.get("clusterAdmin") or False,
            )