TODO: skip non-namespaced resources if namespace is given, or ignore namespace?

 @param namespace [String, nil]
 @return [Array<K8s::ResourceClient>]
762698
def resources(namespace: nil)
      api_resources.map{ |api_resource|
        ResourceClient.new(@transport, self, api_resource,
                           namespace: namespace)
      }
    end
988776
def _namespace_requested(self, namespace):
        """"""
        if namespace is None:
            return False
        namespace_tuple = self._tuplefy_namespace(namespace)
        if namespace_tuple[0] in IGNORE_DBS:
            return False
        elif namespace_tuple[1] in IGNORE_COLLECTIONS:
            return False
        else:
            return self._tuple_requested(namespace_tuple)
1051005
private Map<String, String> namespaces(Kam kam) {
        Map<String, String> nsmap = new HashMap<String, String>();

        // find namespaces in resource index
        List<NamespaceDescriptor> ns = nsrsvc.getAllNamespaceDescriptors();
        for (NamespaceDescriptor n : ns) {
            Namespace the_ns = n.getNamespace();
            nsmap.put(the_ns.getPrefix(), the_ns.getResourceLocation());
        }

        // then find namespaces identified by the KAM
        List<org.openbel.framework.api.internal.KAMStoreDaoImpl.Namespace> nsl =
                kAMStore.getNamespaces(kam);
        for (org.openbel.framework.api.internal.KAMStoreDaoImpl.Namespace kam_ns : nsl) {
            nsmap.put(kam_ns.getPrefix(), kam_ns.getResourceLocation());
        }
        return nsmap;
    }
685495
def namedb_get_namespace_by_preorder_hash( cur, preorder_hash, include_history=True ):
    

    select_query = "SELECT * FROM namespaces WHERE preorder_hash = ?;"
    namespace_rows = namedb_query_execute( cur, select_query, (preorder_hash,))

    namespace_row = namespace_rows.fetchone()
    if namespace_row is None:
        # no such namespace 
        return None 

    namespace = {}
    namespace.update( namespace_row )

    if include_history:
        hist = namedb_get_history( cur, namespace['namespace_id'] )
        namespace['history'] = hist

    namespace = op_decanonicalize(op_get_opcode_name(namespace['op']), namespace)
    return namespace
1006697
def partition_namespace_decls(attrs)
      nonns_attrs = []
      ns_bindings = []
      attrs.each do |name, value| 
        local_part, prefix = split_qname(name)
        if prefix && prefix=="xmlns"
          ns_bindings << [local_part, value]
        elsif !prefix && local_part=="xmlns"
          ns_bindings << ["", value]
        else
          nonns_attrs << [name, value]
        end
      end
      [Hash[nonns_attrs], Hash[ns_bindings]]
    end
4081
def list_services(self, namespace=None):
        

        if namespace:
            return [Service(name=s.metadata.name,
                            ports=k8s_ports_to_metadata_ports(s.spec.ports),
                            namespace=s.metadata.namespace,
                            labels=s.metadata.labels, selector=s.spec.selector, spec=s.spec)
                    for s in self.core_api.list_namespaced_service(namespace, watch=False).items]

        return [Service(name=s.metadata.name,
                        ports=k8s_ports_to_metadata_ports(s.spec.ports),
                        namespace=s.metadata.namespace,
                        labels=s.metadata.labels, selector=s.spec.selector, spec=s.spec)
                for s in self.core_api.list_service_for_all_namespaces(watch=False).items]
195485
def delete_namespace(self, namespace):
        

        # if not self.has_namespace(namespace):
        #     return "Namespace does not exists"

        # log = logging.getLogger("%s.%s" % (self.log_name,
        #                                    inspect.stack()[0][3]))
        # log.setLevel(self.log_level)

        url = self._make_url(namespace).replace("/sparql", "")
        result = requests.delete(url=url)
        if result.status_code == 200:
            log.critical(result.text)
            return result.text
        raise RuntimeError(result.text)
599802
def get_attribute_ns(namespace, name)
      each_attribute() { |attribute|
        if name == attribute.name &&
          namespace == attribute.namespace()
          return attribute
        end
      }
      nil
    end
390850
def namespace_uri(self):
        
        try:
            return next(
                iter(filter(lambda uri: URI(uri).namespace, self._uri))
            )
        except StopIteration:
            return None
841899
def undeclared_namespace_bindings(ns_stack, ns_explicit)
      Hash[ns_explicit.map do |prefix,uri|
             [prefix, uri] if !find_namespace_uri(ns_stack, prefix, uri)
           end.compact]
    end
849182
def namespaces(
            self,
            name=None,
            function=None,
            recursive=None,
            allow_empty=None):
        

        return (
            self._find_multiple(
                scopedef.scopedef_t._impl_matchers[namespace_t.namespace],
                name=name,
                function=function,
                recursive=recursive,
                allow_empty=allow_empty)
        )
530023
def skin_namespace_hash(options = {})
      { 
        :match   =>  options[:match] ? options[:match] : /[\/]/, 
        :replace =>  options[:replace] ? options[:replace] : "_", 
        :prefix  =>  options[:prefix] ? options[:prefix] : nil,
        :root    =>  options[:root] ? options[:root] : "root"
      }
    end
62971
def map_namespace(self, plain_src_ns):
        
        namespace = self.lookup(plain_src_ns)
        if namespace:
            return namespace.dest_name
        return None
16168
public static nsxmlnamespace[] get(nitro_service service, String prefix[]) throws Exception{
		if (prefix !=null && prefix.length>0) {
			nsxmlnamespace response[] = new nsxmlnamespace[prefix.length];
			nsxmlnamespace obj[] = new nsxmlnamespace[prefix.length];
			for (int i=0;i<prefix.length;i++) {
				obj[i] = new nsxmlnamespace();
				obj[i].set_prefix(prefix[i]);
				response[i] = (nsxmlnamespace) obj[i].get_resource(service);
			}
			return response;
		}
		return null;
	}
574286
public static List<String> getNamespacedPod(String namespace, String label) throws ApiException {
    V1PodList listNamespacedPod =
        COREV1_API.listNamespacedPod(
            namespace,
            null,
            null,
            null,
            null,
            label,
            Integer.MAX_VALUE,
            null,
            TIME_OUT_VALUE,
            Boolean.FALSE);
    List<String> listPods =
        listNamespacedPod
            .getItems()
            .stream()
            .map(v1pod -> v1pod.getMetadata().getName())
            .collect(Collectors.toList());
    return listPods;
  }
824651
function namespace (options) {
  options.hash.kind = 'namespace'
  var result = ddata._identifier(options)
  return result ? options.fn(result) : 'ERROR, Cannot find namespace.'
}
123988
public String[] getLocalizedResourceArray(String namespace, String resourceId) throws Exception {
        Class r = Class.forName(namespace + "$string");
        Field f = r.getField(resourceId);
        return getCurrentActivity().getResources().getStringArray(f.getInt(f));
    }