Get the URI from a given URL.

        :returns: URI within the URL
185995
def get_services_url(url, base_url):
        
        length = len(base_url)
        checks = ['http://', 'https://']
        for check in checks:
            if url.startswith(check):
                length = length + len(check)
                break

        result = url[length:]
        logger.debug('{0} from {1} equals {2}'
                     .format(base_url, url, result))
        return result
293061
def uri(self, value, strip_iri=True):
        

        return self.convert_to_uri(value, strip_iri=strip_iri)
662698
def get_uri(self, image):
        '''
        '''
        image = image or ''
        uri = ''

        match = re.match("^(?P<uri>.+)://", image)
        if match:
            uri = match.group('uri')

        return uri
123501
def get_parts_of_url_path(url):
    
    parsed = urlparse(url)
    path = unquote(parsed.path).lstrip('/')
    parts = path.split('/')
    return parts
1029591
def parse_url(self, uri):
        
        parsed = urlparse.urlparse(uri)
        if 'scheme' not in parsed:
            class Object(object):
                pass
            newparsed = Object()
            newparsed.scheme = parsed[0]
            newparsed.netloc = parsed[1]
            newparsed.path = parsed[2]
            newparsed.params = parsed[3]
            newparsed.query = parsed[4]
            newparsed.fragment = parsed[5]
            newparsed.username = ''
            newparsed.password = ''
            newparsed.hostname = ''
            newparsed.port = ''
            parsed = newparsed
        return parsed
11246
def return_current_uri_subpage(self):
        
        uri = post_slash("%s%s/%s/%s" % (post_slash(self.current_dir()),
                         self.slots['page'], self.slots['item'],
                         self.slots['subpage']))
        return uri
1025496
def parse_uri(self, uri=None):

		'''
		
		'''

		# no uri provided, assume root
		if not uri:
			return rdflib.term.URIRef(self.root)

		# string uri provided
		elif type(uri) == str:

			# assume "short" uri, expand with repo root
			if type(uri) == str and not uri.startswith('http'):
				return rdflib.term.URIRef("%s%s" % (self.root, uri))

			# else, assume full uri
			else:
				return rdflib.term.URIRef(uri)

		# already rdflib.term.URIRef
		elif type(uri) == rdflib.term.URIRef:
			return uri

		# unknown input
		else:
			raise TypeError('invalid URI input')
369627
def request_uri(self):
        """"""
        uri = self.path or '/'

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

        return uri
9549
def get_uri(self, ncname: str) -> Optional[str]:
        
        uri = cu.expand_uri(ncname + ':', self.curi_maps)
        return uri if uri and uri.startswith('http') else None
1259727
def url_to_parts(url):
    

    if not url:
        return None

    scheme, netloc, path, query, fragment = _urlsplit(url)

    if not path or path == '/':
        path = []
    else:
        path = path.strip('/').split('/')

    if not query:
        query = {}
    else:
        query = _parse_qs(query)

    return _urllib_parse.SplitResult(scheme, netloc, path, query, fragment)
823503
def retrieve_file_from_url(url):
    
    try:
        alias_source, _ = urlretrieve(url)
        # Check for HTTPError in Python 2.x
        with open(alias_source, 'r') as f:
            content = f.read()
            if content[:3].isdigit():
                raise CLIError(ALIAS_FILE_URL_ERROR.format(url, content.strip()))
    except Exception as exception:
        if isinstance(exception, CLIError):
            raise

        # Python 3.x
        raise CLIError(ALIAS_FILE_URL_ERROR.format(url, exception))

    return alias_source
977562
def get_url(self):
        
        return os.path.join(
            '/archive',
            self.get_year(),
            self.get_month(),
            self.get_day()
        )
382149
def get_ext(url):
    

    parsed = urllib.parse.urlparse(url)
    root, ext = os.path.splitext(parsed.path)
    return ext.lstrip('.')
862573
def __parse_uri(self):
        """"""
        if self.scheme:
            scheme = '{}://'.format(self.scheme)
        else:
            scheme = ''

        credentials = self.username or ''
        password = self.password or ''

        if credentials and password:
            credentials = self.username + ':' + self.password
        if credentials:
            credentials += '@'

        if self.port:
            location = '{}:{}'.format(self.host, self.port)
        else:
            location = self.host

        path = self.path or ''

        if self.query:
            query = '?' + self.query
        else:
            query = ''

        if self.fragment:
            fragment = '#' + self.fragment
        else:
            fragment = ''

        return scheme + credentials + location + path + query + fragment
777768
def get_url(self):
        # type: () -> STRING_TYPE
        """"""

        line = self.line
        try:
            parsed = URI.parse(line)
            line = parsed.to_string(escape_password=False, direct=False, strip_ref=True)
        except ValueError:
            pass
        else:
            self._parsed_url = parsed
            return line
        if self.vcs is not None and self.line.startswith("{0}+".format(self.vcs)):
            _, _, _parseable = self.line.partition("+")
            parsed = urllib_parse.urlparse(add_ssh_scheme_to_git_uri(_parseable))
            line, _ = split_ref_from_uri(line)
        else:
            parsed = urllib_parse.urlparse(add_ssh_scheme_to_git_uri(line))
        if "@" in self.line and parsed.scheme == "":
            name, _, url = self.line.partition("@")
            if self._name is None:
                url = url.strip()
                self._name = name.strip()
                if is_valid_url(url):
                    self.is_direct_url = True
            line = url.strip()
            parsed = urllib_parse.urlparse(line)
            url_path = parsed.path
            if "@" in url_path:
                url_path, _, _ = url_path.rpartition("@")
            parsed = parsed._replace(path=url_path)
        self._parsed_url = parsed
        return line
592714
def get_uri(self, action, obj=None, date=None):
        
        if date is None:
            date = action.timestamp
        date = datetime_safe.new_datetime(date).strftime('%Y-%m-%d')
        return 'tag:%s,%s:%s' % (Site.objects.get_current().domain, date,
                                 self.get_url(action, obj, False))
452611
def _get_url(self, url):
        """"""
        if self.base_url and not url.startswith(('http://', 'https://')):
            return urljoin(self.base_url, url)
        return url