Helper for :meth:`build`.  Returns subdomain and path for the
        rule that accepts this endpoint, values and method.

        :internal:
518316
def _partial_build(self, endpoint, values, method, append_unknown):
        
        # in case the method is none, try with the default method first
        if method is None:
            rv = self._partial_build(
                endpoint, values, self.default_method, append_unknown
            )
            if rv is not None:
                return rv

        # default method did not match or a specific method is passed,
        # check all and go with first result.
        for rule in self.map._rules_by_endpoint.get(endpoint, ()):
            if rule.suitable_for(values, method):
                rv = rule.build(values, append_unknown)
                if rv is not None:
                    return rv
1292108
def url_builder(self, endpoint, params=None, url_params=None):
        """"""
        if url_params is None:
            url_params = OrderedDict()
        url_params[self.AUTH_PARAM] = self.api_token
        return super().url_builder(
            endpoint,
            params=params,
            url_params=url_params,
        )
266848
def build_url(method, args)
        API::URL.new(method, config.base_url, args).path
      end
1184950
def _get_build_flags(cls, build_flags_from_option, is_flagged, target):
    
    # If self.get_options().build_flags returns a quoted string, remove the outer quotes,
    # which happens for flags passed from the command-line.
    if (build_flags_from_option.startswith('\'') and build_flags_from_option.endswith('\'')) or \
        (build_flags_from_option.startswith('"') and build_flags_from_option.endswith('"')):
      bfo = build_flags_from_option[1:-1]
    else:
      bfo = build_flags_from_option
    global_build_flags, ephemeral_build_flags = ('', bfo) if is_flagged else (bfo, '')
    target_build_flags = target.build_flags if getattr(target, 'build_flags', None) else ''
    joined_build_flags = ' '.join([global_build_flags, target_build_flags, ephemeral_build_flags])
    return cls._split_build_flags(joined_build_flags)
636844
def get_subdomain_resolver(name, db_path=None, zonefiles_dir=None):
    
    opts = get_blockstack_opts()
    if not is_subdomains_enabled(opts):
        log.warn("Subdomain support is disabled")
        return None

    if db_path is None:
        db_path = opts['subdomaindb_path']

    if zonefiles_dir is None:
        zonefiles_dir = opts['zonefiles']

    db = SubdomainDB(db_path, zonefiles_dir)
    resolver_url = db.get_domain_resolver(name)

    return resolver_url
693745
def get_subsites(self):
        
        url = self.build_url(
            self._endpoints.get('get_subsites').format(id=self.object_id))

        response = self.con.get(url)
        if not response:
            return []

        data = response.json()

        # Everything received from cloud must be passed as self._cloud_data_key
        return [self.__class__(parent=self, **{self._cloud_data_key: site}) for
                site in data.get('value', [])]
93812
def add_url_rule(self, rule, endpoint=None, view_func=None, **options):
        
        self.record(lambda s: s.add_url_rule(rule, endpoint, view_func,
                                             register_with_babel=False, **options))
797198
def build(
        cls,
        *,
        scheme="",
        user="",
        password=None,
        host="",
        port=None,
        path="",
        query=None,
        query_string="",
        fragment="",
        encoded=False
    ):
        """"""

        if not host and scheme:
            raise ValueError('Can\'t build URL with "scheme" but without "host".')
        if port and not host:
            raise ValueError('Can\'t build URL with "port" but without "host".')
        if query and query_string:
            raise ValueError('Only one of "query" or "query_string" should be passed')
        if path is None or query_string is None or fragment is None:
            raise TypeError('NoneType is illegal for "path", "query_string" and '
                            '"fragment" args, use string values instead.')

        if not user and not password and not host and not port:
            netloc = ""
        else:
            netloc = cls._make_netloc(user, password, host, port, encode=not encoded)
        if not encoded:
            path = cls._PATH_QUOTER(path)
            if netloc:
                path = cls._normalize_path(path)

            cls._validate_authority_uri_abs_path(host=host, path=path)
            query_string = cls._QUERY_QUOTER(query_string)
            fragment = cls._FRAGMENT_QUOTER(fragment)

        url = cls(
            SplitResult(scheme, netloc, path, query_string, fragment), encoded=True
        )

        if query:
            return url.with_query(query)
        else:
            return url
771580
def build_url(self):
        
        url = '{protocol}/{url}/{rest}/{version}/{restapi}/{rscpath}/' \
              '{query}'.format(protocol=self.schema.protocol,
                               url=self.schema.main_url,
                               rest=self.schema.rest,
                               version=self.schema.version,
                               restapi=self.schema.restApi,
                               rscpath=self.schema.resourcePath,
                               query=self.schema.query)
        return url.replace('/None/', '/')
37953
def build_url(self, _name, **kwargs):
        '''
        
        '''
        used_args, subreverse =  self._build_url_silent(_name, **kwargs)

        if set(kwargs).difference(used_args):
            raise UrlBuildingError(
                'Not all arguments are used during URL building: {}'\
                    .format(', '.join(set(kwargs).difference(used_args))))
        return subreverse.as_url
166898
def full_rule(self):
        
        return join(self.bp_prefix, self.rule, trailing_slash=self.rule.endswith('/'))
296936
def match(self, rule):
        
        if self.methods:
            for method in self.methods:
                if method in rule.methods:
                    return True

        if self.endpoints:
            for endpoint in self.endpoints:
                if endpoint == rule.endpoint:
                    return True

        return False
122583
def add_url_rule(self, rule, endpoint=None, view_func=None, **options):
        
        if self.url_prefix:
            rule = self.url_prefix + rule
        options.setdefault('subdomain', self.subdomain)
        if endpoint is None:
            endpoint = _endpoint_from_view_func(view_func)
        defaults = self.url_defaults
        if 'defaults' in options:
            defaults = dict(defaults, **options.pop('defaults'))
        self.app.add_url_rule(rule, endpoint, view_func, defaults=defaults, **options)
528638
def _build_base_url(self, host, port):
        
        parsed = urlparse(host)
        if not parsed.scheme:
            parsed = parsed._replace(scheme="http")
            parsed = parsed._replace(path="")
            netloc, parts = host, host.partition(":")
            if parts[1] == "" and port is not None:
                netloc = "{}:{}".format(parts[0], port)
            parsed = parsed._replace(netloc=netloc)
        parsed = parsed._replace(path=parsed.path.rstrip("/"))
        return parsed.geturl()
1316219
def find_matching_endpoints(self, swagger_ns):
        
        def match_func(operation, ns, rule):
            # only expose endpoints that have the correct path prefix and operation
            return (
                rule.rule.startswith(self.graph.build_route_path(swagger_ns.path, swagger_ns.prefix)) and
                operation in self.matching_operations
            )

        return list(iter_endpoints(self.graph, match_func))
1374577
function buildEndpoint(config, path) {
  var host = config.host;
  var port = config.port;

  if (!host) throw new Error('No host is specified in proxied method config');

  var base = host + (port ? ':' + port : '');
  var fullpath = '/isomorphine/' + path;
  var endpoint = base + fullpath;

  debug('Built endpoint: ' + endpoint);

  return endpoint;
}
770541
def build_url(self, path):
        
        url = '{0}{1}'.format(self.base_url, path)
        url = re.sub('([^:])//', '\\1/', url)  # Remove double slashes
        return url