Add an alias from this namespace URI to the desired alias
188411
def addAlias(self, namespace_uri, desired_alias, implicit=False):
        
        if isinstance(namespace_uri, bytes):
            namespace_uri = str(namespace_uri, encoding="utf-8")
        # Check that desired_alias is not an openid protocol field as
        # per the spec.
        assert desired_alias not in OPENID_PROTOCOL_FIELDS, \
               "%r is not an allowed namespace alias" % (desired_alias,)

        # Check that desired_alias does not contain a period as per
        # the spec.
        if isinstance(desired_alias, str):
            assert '.' not in desired_alias, \
                   "%r must not contain a dot" % (desired_alias,)

        # Check that there is not a namespace already defined for
        # the desired alias
        current_namespace_uri = self.alias_to_namespace.get(desired_alias)
        if (current_namespace_uri is not None and
                current_namespace_uri != namespace_uri):

            fmt = ('Cannot map %r to alias %r. '
                   '%r is already mapped to alias %r')

            msg = fmt % (namespace_uri, desired_alias, current_namespace_uri,
                         desired_alias)
            raise KeyError(msg)

        # Check that there is not already a (different) alias for
        # this namespace URI
        alias = self.namespace_to_alias.get(namespace_uri)
        if alias is not None and alias != desired_alias:
            fmt = ('Cannot map %r to alias %r. '
                   'It is already mapped to alias %r')
            raise KeyError(fmt % (namespace_uri, desired_alias, alias))

        assert (desired_alias == NULL_NAMESPACE or
                type(desired_alias) in [str, str]), repr(desired_alias)
        assert namespace_uri not in self.implicit_namespaces
        self.alias_to_namespace[desired_alias] = namespace_uri
        self.namespace_to_alias[namespace_uri] = desired_alias
        if implicit:
            self.implicit_namespaces.append(namespace_uri)
        return desired_alias
79000
function(name, realpath) {
        if (regAlias.test(name)) {
            if ($.isUndefined(realpath)) {
                return mapAlias[name];
            }
            mapAlias[name] = String(realpath).split(',');
        } else if ($.isObject(name)) {
            realpath = name.path;
            name = name;
            _.alias(name, realpath);
        }
    }
636329
public String namespaceURI() {
        if (namespacePrefix == null || namespacePrefix.isEmpty()) return "";
        String uri = namespaceTagHints.get(namespacePrefix);
        return uri == null ? "" : uri;
    }
95163
private static URI createUriFromName(String name) {
        if (name == null) {
            throw new NullPointerException("name");
        }
        try {
            return new URI(name);
        } catch (final URISyntaxException e) {
            throw new IllegalArgumentException("Invalid name: " + name, e);
        }
    }
723754
def register_prefix(self, nspair):
        
        for prefix, uri in nspair.items():
            try:
                ElementTree.register_namespace(prefix, uri)
            except AttributeError:
                # Backwards compatibility with ET < 1.3
                ElementTree._namespace_map[uri] = prefix
            except ValueError:
                pass
1323318
public static function setAlias()
    {
        $file = file_get_contents(self::$aliasFilePath);

        $newAliasString = str_replace(
            "'".self::$bowerVendor."'", 
            "'".self::$sourceBower."'", 
            self::$aliasBowerString
            );

        $file = str_replace(
            self::$aliasBowerString, 
            $newAliasString, 
            $file
            );

        $result = file_put_contents(self::$aliasFilePath, $file);

        if ($result) {
            
            echo "Install alias @bower done\n";
        }
    }
974176
public void setNamespace(String prefix, String uri) {

    this.prefix2namespace.put(prefix, uri);
    this.namespace2prefix.put(uri, prefix);
  }
537553
public void addAliasForLocator(String alias, String locator) {
		LOG.info("Add alias: '" + alias + "' for '" + locator + "'");
		aliases.put(alias, locator);
	}
267519
def process_alias_create_namespace(namespace):
    
    namespace = filter_alias_create_namespace(namespace)
    _validate_alias_name(namespace.alias_name)
    _validate_alias_command(namespace.alias_command)
    _validate_alias_command_level(namespace.alias_name, namespace.alias_command)
    _validate_pos_args_syntax(namespace.alias_name, namespace.alias_command)
82082
def add_alias(self, alias):
        
        objs = object_session(self)
        
        if isinstance(alias, list):
            raise NotImplementedError
        elif isinstanceofany(alias, (str, unicode)):
            a = SymbolAlias(self, alias)
            self.aliases.append(a)
            objs.add(a)
1191656
public function aliasNamespace($from, $to)
	{
		$from = trim($from, '\\');
		$to = trim($to, '\\');

		$this->namespaces[] = [$from, $to];
	}
442809
public function addNamespace($uri, $prefix = 'default')
    {
        if (strlen($uri) == 0) {
            throw new \InvalidArgumentException(sprintf('Namespace URI should not be empty'));
        }

        $this->namespaces[$prefix] = $uri;

        return $this;
    }
1321290
def p_alias(self, p):
        """"""
        if p[1] == 'alias':
            has_annotations = len(p) > 6 and p[7] is not None
            doc = p[8] if len(p) > 6 else None
            p[0] = AstAlias(
                self.path, p.lineno(1), p.lexpos(1), p[2], p[4], doc)
            if has_annotations:
                p[0].set_annotations(p[7])
        else:
            raise ValueError('Expected alias keyword')
1076196
def _add_namespace(self, namespace):
        """"""
        src_name = namespace.source_name
        if "*" in src_name:
            self._regex_map.append((namespace_to_regex(src_name), namespace))
        else:
            self._add_plain_namespace(namespace)
279271
def uri(self, element, namespace=None):
        ''

        if namespace is None:
            namespace = self.namespace

        return URIRef('%s#%s' % (namespace, element))
192730
def using(self, alias):
        
        clone = self._clone()
        clone._index = alias
        return clone
200816
def _getAlias(self, auth_level_uri):
        
        for (alias, existing_uri) in self.auth_level_aliases.iteritems():
            if auth_level_uri == existing_uri:
                return alias

        raise KeyError(auth_level_uri)