Get a uri prefix from the input configuration.
484041
public static String resolveUriPrefix(Config config, SharedRestClientKey key) throws URISyntaxException, NotConfiguredException {

    List<String> connectionPrefixes = parseConnectionPrefixes(config, key);
    Preconditions.checkArgument(connectionPrefixes.size() > 0, "No uris found for service " + key.serviceName);

    return connectionPrefixes.get(new Random().nextInt(connectionPrefixes.size()));
  }
111908
def _getPrefixURL(self, url):
        
        for prefix, namespace in self._rdfGraph.namespaces():
            if namespace.toPython() in url:
                return namespace
591471
def get_uri_name(url):
    """"""
    url_parsed = urlparse(url)

    url_parts = url_parsed.path.split('/')

    log.info('url parts: %s', url_parts)

    return url_parts[-1]
1130691
private function getUriPrefix()
	{
		$mode = strtolower($this->getMode());
		switch ($mode) {
			case 'live':
				$prefix = CheckoutApi_Client_Constant::APIGW3_URI_PREFIX_LIVE.CheckoutApi_Client_Constant::VERSION.'/';
				break;
            default :
                $prefix = CheckoutApi_Client_Constant::APIGW3_URI_PREFIX_SANDBOX.CheckoutApi_Client_Constant::VERSION.'/';
                break;    
		}
		return $prefix;
	}
647294
public static String getPrefixedUri(String prefix, String uri) {
        String localURI = uri;
        if (localURI.length() > 0) {
            // Put a / between the prefix and the tail only if:
            // the prefix does not ends with a /
            // the tail does not start with a /
            // the tail starts with an alphanumeric character.
            if (!localURI.startsWith("/")
                    && !prefix.endsWith("/")
                    && Character.isLetterOrDigit(localURI.indexOf(0))) {
                localURI = prefix + "/" + localURI;
            } else {
                localURI = prefix + localURI;
            }
        } else {
            // Empty tail, just return the prefix.
            return prefix;
        }
        return localURI;
    }
1020175
public String lookupNamespace(String prefix)
    {
        String uri = null;
        final Stack stack = getPrefixStack(prefix);
        if (stack != null && !stack.isEmpty()) {
            uri = ((MappingRecord) stack.peek()).m_uri;
        }
        if (uri == null)
            uri = EMPTYSTRING;
        return uri;
    }
1230720
def _url(self, uri):
        """"""
        prefix = "{}://{}{}".format(
            self._protocol,
            self.real_connection.host,
            self._port_postfix(),
        )
        return uri.replace(prefix, '', 1)
369627
def request_uri(self):
        """"""
        uri = self.path or '/'

        if self.query is not None:
            uri += '?' + self.query

        return uri
1297419
def get(self, namespacePrefix):
        """"""
        ns = db.ConfigNamespace.find_one(ConfigNamespace.namespace_prefix == namespacePrefix)
        if not ns:
            return self.make_response('No such namespace: {}'.format(namespacePrefix), HTTP.NOT_FOUND)

        return self.make_response({
            'message': None,
            'namespace': ns
        })
411166
def uri2module(self, uri):
        """"""
        module_name = uri.replace('.', '&#DOT')
        module_name = module_name.replace(os.sep, '&#SEP')
        return self.module_prefix + module_name
542381
public function getUri(): string
    {
        $configuration = GeneralUtility::makeInstance(ConfigurationService::class);

        // Find host-name / IP, always in lowercase:
        $isHttp = (0 === \mb_strpos(GeneralUtility::getIndpEnv('TYPO3_REQUEST_HOST'), 'http://'));
        $uri = GeneralUtility::getIndpEnv('REQUEST_URI');
        if ($configuration->isBool('recreateURI')) {
            $uri = $this->recreateUriPath($uri);
        }

        $uri = ($isHttp ? 'http://' : 'https://') . \mb_strtolower(GeneralUtility::getIndpEnv('HTTP_HOST')) . '/' . \ltrim($uri, '/');

        try {
            $idnaConverter = GeneralUtility::makeInstance(IdnaConvert::class);

            return $idnaConverter->encode($uri);
        } catch (\InvalidArgumentException $exception) {
            // The URI is already in puny code (no logging needed)
            return $uri;
        }
    }
1318395
@Override
    public String doGetNamespaceURI(String prefix)
    {
        // Note: base class checks for 'known' problems and prefixes:
        if (mNsByPrefix == null) {
            mNsByPrefix = buildByPrefixMap();
        }
        Namespace ns = mNsByPrefix.get(prefix);
        if (ns == null && mParentCtxt != null) {
            return mParentCtxt.getNamespaceURI(prefix);
        }
        return (ns == null) ? null : ns.getNamespaceURI();
    }
1276024
def __extend_uri(prefixes, short):
    
    for prefix in prefixes:
        if short.startswith(prefix):
            return short.replace(prefix + ':', prefixes[prefix])
    return short
223338
def _resource_prefix(self, resource=None):
        
        px = 'ELASTICSEARCH'
        if resource and config.DOMAIN[resource].get('elastic_prefix'):
            px = config.DOMAIN[resource].get('elastic_prefix')
        return px
707144
function prefix( state, url ) {
	if ( state.config.urlPrefix ) {
		if ( _.isRegExp( url ) ) {
			return regex.prefix( state.config.urlPrefix, url );
		} else {
			var prefixIndex = url.indexOf( state.config.urlPrefix );
			var appliedPrefix = prefixIndex === 0 ? '' : state.config.urlPrefix;
			return buildUrl( appliedPrefix, url );
		}
	} else {
		return url;
	}
}
595051
String getURI (String prefix)
    {
        if ("".equals(prefix)) {
            return defaultNS;
        } else if (prefixTable == null) {
            return null;
        } else {
            return (String)prefixTable.get(prefix);
        }
    }
309196
public static String getLocalName(final String uri, final String prefix) {
        String ns = getNSFromPrefix(prefix);
        if (ns != null) {
            return uri.replace(ns, "");
        }
        throw new IllegalArgumentException("Undefined prefix (" + prefix + ") in URI: " + uri);
    }