Returns a name that can be used to reference `name` in namespace `name_ns`
    from `source_ns`.

    If `source_ns` and `name_ns` are the same, that's just `name`. Otherwise
    it's `name_ns`.`name`.
183762
def prefix_with_ns_if_necessary(name, name_ns, source_ns):
    # type: (typing.Text, ApiNamespace, ApiNamespace) -> typing.Text
    
    if source_ns == name_ns:
        return name
    return '{}.{}'.format(fmt_namespace(name_ns.name), name)
782792
def get_source(self, key, name_spaces=None, default_prefix=''):
        
        source = self.source or key
        prefix = default_prefix
        if name_spaces and self.name_space and self.name_space in name_spaces:
            prefix = ''.join([name_spaces[self.name_space], ':'])
        return ''.join([prefix, source])
993652
public boolean hasName(String name, String namespace) {
        return hasName(name) && Objects.equals(this.namespace, namespace);
    }
1231803
def get_ns_commands(self, cmd_name):
        
        namespace, command = _split_ns_command(cmd_name)
        if not namespace:
            # Name space not given, look for the commands
            spaces = self.__find_command_ns(command)
            if not spaces:
                # Unknown command
                raise ValueError("Unknown command {0}".format(command))
            else:
                # Return a sorted list of tuples
                return sorted((namespace, command) for namespace in spaces)

        # Single match
        return [(namespace, command)]
136379
def _fake_referencenames(self, namespace, **params):
        
        assert params['ResultClass'] is None or \
            isinstance(params['ResultClass'], CIMClassName)

        rc = None if params['ResultClass'] is None else \
            params['ResultClass'].classname
        role = params['Role']
        obj_name = params['ObjectName']
        classname = obj_name.classname

        if isinstance(obj_name, CIMClassName):
            ref_classnames = self._get_reference_classnames(classname,
                                                            namespace,
                                                            rc, role)

            ref_result = [CIMClassName(classname=cn, host=self.host,
                                       namespace=namespace)
                          for cn in ref_classnames]

            return self._return_assoc_tuple(ref_result)

        assert isinstance(obj_name, CIMInstanceName)
        ref_paths = self._get_reference_instnames(obj_name, namespace,
                                                  rc, role)
        rtn_names = [deepcopy(r) for r in ref_paths]

        for iname in rtn_names:
            if iname.host is None:
                iname.host = self.host

        return self._return_assoc_tuple(rtn_names)
711918
def name_match(self, elt):
        '''
        '''
        return self.pname == elt.localName and \
                    self.nspname in [None, '', elt.namespaceURI]
95923
def _get_reconciled_name_object(self, other):
        
        name = get_op_result_name(self, other)
        if self.name != name:
            return self._shallow_copy(name=name)
        return self
803309
def make_ns(self, ns):
        '''
        
        '''
        if self.namespace:
            val = {}
            val.update(self.namespace)
            val.update(ns)
            return val
        else:
            return ns
172100
def name(self):
        
        if self.xc in self.defined_aliases: return self.defined_aliases[self.xc].name
        xc = (self.x, self.c)
        if xc in self.defined_aliases: return self.defined_aliases[xc].name
        if self.xc is not None: return self.xc.name
        return "+".join([self.x.name, self.c.name])
1051396
function namespace(ns) {
  var names = ns.split('.');
  var owner = window;
  for (var i = 0; i < names.length; i++) {
    var name = names[i];
    owner[name] = owner[name] || {};
    owner = owner[name];
  }
  return owner;
}
371453
def ndsname(self):
        
        if self.type not in [None, 'raw', 'reduced', 'online']:
            return '%s,%s' % (self.name, self.type)
        return self.name
995865
def lookup(self, plain_src_ns):
        
        # Ignore the namespace if it is excluded.
        if plain_src_ns in self._ex_namespace_set:
            return None
        # Include all namespaces if there are no included namespaces.
        if not self._regex_map and not self._plain:
            return Namespace(
                dest_name=plain_src_ns,
                source_name=plain_src_ns,
                include_fields=self._include_fields,
                exclude_fields=self._exclude_fields,
            )
        # First, search for the namespace in the plain namespaces.
        try:
            return self._plain[plain_src_ns]
        except KeyError:
            # Search for the namespace in the wildcard namespaces.
            for regex, namespace in self._regex_map:
                new_name = match_replace_regex(regex, plain_src_ns, namespace.dest_name)
                if not new_name:
                    continue
                # Save the new target Namespace in the plain namespaces so
                # future lookups are fast.
                new_namespace = namespace.with_options(
                    dest_name=new_name, source_name=plain_src_ns
                )
                self._add_plain_namespace(new_namespace)
                return new_namespace

        # Save the not included namespace to the excluded namespaces so
        # that future lookups of the same namespace are fast.
        self._ex_namespace_set.add(plain_src_ns)
        return None
411448
def name(self, name):
        
        from_name = self.name
        assert isinstance(name, str)
        self._name = name
        if self.has_parent():
            self._parent_._name_changed(self, from_name)
1171518
def get_available_name(self, name):
        
        if self.exists(name):
            self.delete(name)
        return name
528009
def getReferenceByName(self, name):
        
        if name not in self._referenceNameMap:
            raise exceptions.ReferenceNameNotFoundException(name)
        return self._referenceNameMap[name]
1238256
def read(ns_name, source)
      ast = Clojure::Reader.new(source).ast
      ns = namespace ns_name.to_sym
      ast.map { |form| ns.evaluate form }.last
    end
3313
def name(self, name: str):
        

        self.pathName = os.path.join(self.path, name)