Build URL from a path.

        :param path: relative path of the schema.
        :returns: The schema complete URL or ``None`` if not found.
491004
def path_to_url(self, path):
        
        if path not in self.schemas:
            return None
        return self.url_map.bind(
            self.app.config['JSONSCHEMAS_HOST'],
            url_scheme=self.app.config['JSONSCHEMAS_URL_SCHEME']
        ).build(
            'schema', values={'path': path}, force_external=True)
891274
def _get_child_from_path(self, path):
        

        keys = path.split(".")

        this_child = self

        for key in keys:

            try:

                this_child = this_child._get_child(key)

            except KeyError:

                raise KeyError("Child %s not found" % path)

        return this_child
1114316
def _parse_path(self, path):
        
        paths = path.split('/')
        current_path = paths[0]
        for p in paths[1:]:
            current_path = "{}/{}".format(current_path, p)
            if not self.map.get(current_path): # Create any folders that might not exist yet
                self._commit(current_path, p)
1083159
def build_uri(path, options = {})
      uri = URI.join(host, path)
      uri.query = URI.encode_www_form(options)
      uri
    end
370418
def get_url(self, path):
        
        host = ('[' + self.host + ']' if (self.host.find(':') != -1)
                else self.host)
        base_url = self.protocol + '://' + host + ':' + str(self.port)
        return base_url + '/v3alpha/' + path.lstrip("/")
535898
def build_url(base_url, path):
    
    if absolute_http_url_regexp.match(path):
        return path
    elif base_url:
        return "{}/{}".format(base_url.rstrip("/"), path.lstrip("/"))
    else:
        raise ParamsError("base url missed!")
1140293
def path2route(path: SchemaPath) -> SchemaRoute:
        
        if path == "/" or path == "":
            return []
        nlist = path.split("/")
        prevns = None
        res = []
        for n in (nlist[1:] if path[0] == "/" else nlist):
            p, s, loc = n.partition(":")
            if s:
                if p == prevns:
                    raise InvalidSchemaPath(path)
                res.append((loc, p))
                prevns = p
            elif prevns:
                res.append((p, prevns))
            else:
                raise InvalidSchemaPath(path)
        return res
403779
private GenericUrl getURL(final String path) {
		final StringBuilder builder = new StringBuilder(getHostname());
		builder.append(path);
		return new GenericUrl(builder.toString());
	}
549430
def make_path_relative(path):
    
    if os.path.isabs(path):
        drive_s,path = os.path.splitdrive(path)

        import re
        if not drive_s:
            path=re.compile("/*(.*)").findall(path)[0]
        else:
            path=path[1:]

    assert( not os.path.isabs( path ) ), path
    return path
1295878
def import_from_path(path):
    
    if path is None:
        return

    obj = locate(path)
    if obj is None:
        raise ImportError(
            "`{}` could not be imported".format(path)
        )

    return obj
703903
def build_from_path(path)
      if !File.directory?(path) && File.basename(path) == 'Dockerfile'
        path = File.dirname(path)
      end
      File.directory?(path) ? build_from_dir(path) : build_from_file(path)
    end
1078273
def from_path(cls, path: pathlib.Path) -> 'Entity':
        
        if path.is_file():
            return File.from_path(path)
        return Directory.from_path(path)
146735
def from_path(cls, path: pathlib.Path) -> 'Directory':
        
        if not path.is_dir():
            raise ValueError('Path does not point to a directory')
        return Directory(path.name, {entity.name: Entity.from_path(entity)
                                     for entity in path.iterdir()})
997828
def _build_path(self, path, metric_type):
        
        path = self._get_prefixes(metric_type) + list(path)
        return '{}.{}'.format(self._namespace,
                              '.'.join(str(p).replace('.', '-') for p in path))
301116
def url_join(url, path):
    
    p = six.moves.urllib.parse.urlparse(url)

    t = None
    if p.path and p.path[-1] == '/':
        if path and path[0] == '/':
            path = path[1:]
        t = ''.join([p.path, path])
    else:
        t = ('' if path and path[0] == '/' else '/').join([p.path, path])

    return six.moves.urllib.parse.urlunparse(
        p[:2]+
        (t,)+ # os.sep is different on windows, don't use it here.
        p[3:]
    )
1296185
def _get_url(self, path):
        
        options = self._options.copy()
        options.update({'path': path})
        return self._base_url.format(**options)
1058285
def from_path(cls, path):
        """"""
        urlparts = urlparse.urlsplit(path)
        site = 'nonlocal'
        if (urlparts.scheme == '' or urlparts.scheme == 'file'):
            if os.path.isfile(urlparts.path):
                path = os.path.abspath(urlparts.path)
                path = urlparse.urljoin('file:',
                                        urllib.pathname2url(path)) 
                site = 'local'

        fil = File(os.path.basename(path))
        fil.PFN(path, site)
        return fil