Accepts either 'public' or 'private' as a parameter, and returns the
        corresponding value for 'public_url' or 'private_url', respectively.
194571
def get(self, url_type):
        
        lowtype = url_type.lower()
        if lowtype == "public":
            return self.public_url
        elif lowtype == "private":
            return self.private_url
        else:
            raise ValueError("Valid values are 'public' or 'private'; "
                    "received '%s'." % url_type)
814063
def get_public_dsn(self, scheme=None):
        
        if self.is_enabled():
            url = self.remote.get_public_dsn()
            if scheme:
                return '%s:%s' % (scheme, url)

            return url
295667
def get_url(self, url_or_dict):
        
        if isinstance(url_or_dict, basestring):
            url_or_dict = {'viewname': url_or_dict}
        try:
            return reverse(**url_or_dict)
        except NoReverseMatch:
            if MENU_DEBUG:
                print >>stderr,'Unable to reverse URL with kwargs %s' % url_or_dict
858564
def clean_tenant_url(url_string):
    
    if hasattr(settings, 'PUBLIC_SCHEMA_URLCONF'):
        if (settings.PUBLIC_SCHEMA_URLCONF and
                url_string.startswith(settings.PUBLIC_SCHEMA_URLCONF)):
            url_string = url_string[len(settings.PUBLIC_SCHEMA_URLCONF):]
    return url_string
809790
def parse_url(url):
    
    if url.startswith(('http', 'https', '//')):
        if url.startswith('//'):
            return urlparse.urlparse(url, scheme='http')
        else:
            return urlparse.urlparse(url)
    else:
        return urlparse.urlparse(urlparse.urljoin('http://', url))
49582
def privateparts(self, domain):
        
        s = self.privatesuffix(domain)
        if s is None:
            return None
        else:
            # I know the domain is valid and ends with private suffix
            pre = domain[0:-(len(s)+1)]
            if pre == "":
                return (s,)
            else:
                return tuple(pre.split(".") + [s])
963323
def urlparse(url):
    
    value = 'http%s' % url[5:] if url[:5] == 'postgresql' else url
    parsed = _urlparse.urlparse(value)
    path, query = parsed.path, parsed.query
    hostname = parsed.hostname if parsed.hostname else ''
    return PARSED(parsed.scheme.replace('http', 'postgresql'),
                  parsed.netloc,
                  path,
                  parsed.params,
                  query,
                  parsed.fragment,
                  parsed.username,
                  parsed.password,
                  hostname.replace('%2f', '/'),
                  parsed.port)
848754
def get(value: str) -> 'Protocol':
        

        for pktype in PublicKeyType:
            if value in (pktype.ver_type, pktype.authn_type):
                return pktype
        return None
54982
def _IsValidUrl(self, url):
    
    parsed_url = urlparse.urlparse(url)
    return parsed_url.scheme in self._SUPPORTED_URL_SCHEMES
1289815
def get_private_and_public(username, password_verifier, private, preset):
    """"""
    session = SRPServerSession(
        SRPContext(username, prime=preset[0], generator=preset[1]),
        hex_from_b64(password_verifier), private=private)

    click.secho('Server private: %s' % session.private_b64)
    click.secho('Server public: %s' % session.public_b64)
626524
def get_url_param(self, index, default=None):
        
        params = self.get_url_params()
        return params[index] if index < len(params) else default
716591
def id_from_url(url, param_name: str) -> int:
    
    if url is None:
        raise ValueError('url is none')
    elif isinstance(url, int):
        # Seems to already be the url.
        return url
    if not url:
        raise ValueError('Seems to be empty')

    try:
        return int(url)
    except ValueError:
        pass

    parsed = urlparse(url)
    try:
        resource_url = app.url_map.bind(parsed.netloc).match(
            parsed.path
        )
    except NotFound:
        raise ValueError('No URL found')

    if param_name in resource_url[1]:
        return resource_url[1][param_name]
    else:
        raise ValueError(
            'Parameter {name} could not be extracted'.format(
                name=param_name
            )
        )
459393
function (protocol) {
      protocol = protocol || 'http';
      return protocol + '://' + publicRuleMethods._str(3, null, ALPHA_LOWER_CASE_CHARS) + '.' + publicRuleMethods._str(5, 15, ALPHA_LOWER_CASE_CHARS) + '.' + publicRuleMethods._str(2, 8, ALPHA_LOWER_CASE_CHARS);
    }
685676
def is_url(value):
    ""
    if not isinstance(value, str):
        return False
    if not value.startswith('http://') and not value.startswith('https://'):
        return False
    # Any whitespace at all is invalid
    if whitespace_re.search(value):
        return False
    return True
641460
def get_arthur_params_from_url(cls, url):
        # In the url the org and the repository are included

        params = url.split()
        
        params = {"owner": params[0], "repository": params[1]}

        return params
972971
def _get_ip_public(self, queue_target, url, json=False, key=None):
        """"""
        try:
            response = urlopen(url, timeout=self.timeout).read().decode('utf-8')
        except Exception as e:
            logger.debug("IP plugin - Cannot open URL {} ({})".format(url, e))
            queue_target.put(None)
        else:
            # Request depend on service
            try:
                if not json:
                    queue_target.put(response)
                else:
                    queue_target.put(loads(response)[key])
            except ValueError:
                queue_target.put(None)
678240
def url(self, var, default=NOTSET):
        
        return self.get_value(var, cast=urlparse, default=default, parse_default=True)