of the domain of the URL to rank well in search engine results.
505130
public static function getDomainAuthority($url = false)
    {
        $data = static::getCols('68719476736', Helper\Url::parseHost($url));
        return (parent::noDataDefaultValue() == $data) ? $data :
            $data['pda'];
    }
403235
def get_subdomain(url):
        
        allowed_domain = UrlExtractor.get_allowed_domain(url)
        return allowed_domain[:len(allowed_domain) - len(
            UrlExtractor.get_allowed_domain(url, False))]
461308
def domain_search(auth=None, **kwargs):
    '''
    
    '''
    cloud = get_operator_cloud(auth)
    kwargs = _clean_kwargs(**kwargs)
    return cloud.search_domains(**kwargs)
1016430
def indexOf(self, url):
        
        for i, (m_url, _) in enumerate(self._stack):
            if m_url == url:
                return i
        return -1
832947
def url_is_from_any_domain(url, domains):
    """"""
    host = parse_url(url).netloc.lower()

    if host:
        return any(((host == d.lower()) or (host.endswith('.%s' % d.lower())) for d in domains))
    else:
        return False
602933
def filter_by_domain(self, domain):
        
        query = self._copy()
        query.domain = domain
        return query
532038
def parse_search_url(url):
    """"""

    config = {}

    url = urlparse.urlparse(url)

    # Remove query strings.
    path = url.path[1:]
    path = path.split('?', 2)[0]

    if url.scheme in SEARCH_SCHEMES:
        config["ENGINE"] = SEARCH_SCHEMES[url.scheme]

    if url.scheme in USES_URL:
        config["URL"] = urlparse.urlunparse(("http",) + url[1:])

    if url.scheme in USES_INDEX:
        if path.endswith("/"):
            path = path[:-1]

        split = path.rsplit("/", 1)

        if len(split) > 1:
            path = split[:-1]
            index = split[-1]
        else:
            path = ""
            index = split[0]

        config.update({
            "URL": urlparse.urlunparse(("http",) + url[1:2] + (path,) + url[3:]),
            "INDEX_NAME": index,
        })

    if url.scheme in USES_PATH:
        config.update({
            "PATH": path,
        })

    return config
489887
function _cleanURL(url) {
        var index = url.search(/[#\?]/);
        if (index >= 0) {
            url = url.substr(0, index);
        }
        return url;
    }
955678
def _domain_differs(self, href):
        
        target = utils.get_domain(href)
        if not target:
            return False

        origin = utils.get_domain(self.url)
        return target != origin
57769
def full_url(url='', domain=None, protocol='https'):
    
    if domain is None:
        from django.contrib.sites.models import Site
        domain = Site.objects.get_current().domain
    return f'{protocol}://{domain}{url}'
476667
def get_domain_name(url):
    
    if not url.startswith("http"):
        url = "http://" + url
    if not is_valid_url(url):
        raise ValueError("Invalid URL '%s'" % url)
    parse = urlparse(url)
    return parse.netloc
658972
def get_domain_url(url):
    
    if "http://" not in url and "https://" not in url:
        return url
    url_header = url.split('://')[0]
    simple_url = url.split('://')[1]
    base_url = simple_url.split('/')[0]
    domain_url = url_header + '://' + base_url
    return domain_url
622120
function (url) {
	var result;

	LIST.some(function (state) {
		var params = state.pattern.match(url);

		if (params) {
			result       = state;
			state.params = params;
			return true;
		}
	});

	if (result) {
		var state        = result,
			parent_index = state.name.lastIndexOf('.'), parent_name;

		while (parent_index !== -1) {
			parent_name  = state.name.substring(0, parent_index);
			state.parent = STATES[parent_name];
			state        = state.parent;

			parent_index = state.name.lastIndexOf('.');
		}

		return result;
	}
}
656446
def domain_of_validity(self):
        
        # TODO: Generalise interface to return a polygon? (Can we find
        # something that uses a polygon instead?)
        domain = self.element.find(GML_NS + 'domainOfValidity')
        domain_href = domain.attrib[XLINK_NS + 'href']
        url = '{prefix}{code}.gml?download'.format(prefix=EPSG_IO_URL,
                                                   code=domain_href)
        xml = requests.get(url).content
        gml = ET.fromstring(xml)

        def extract_bound(tag):
            ns = '{http://www.isotc211.org/2005/gmd}'
            xpath = './/{ns}EX_GeographicBoundingBox/{ns}{tag}/'.format(
                ns=ns,
                tag=tag)
            bound = gml.find(xpath)
            return float(bound.text)

        tags = ('westBoundLongitude', 'eastBoundLongitude',
                'southBoundLatitude', 'northBoundLatitude')
        bounds = [extract_bound(tag) for tag in tags]
        return bounds
1028494
public static function getAlexaRank($domain)
    {
        $domain = preg_replace('~^https?://~', '', $domain);
        $alexa = 'http://data.alexa.com/data?cli=10&dat=s&url=%s';
        $request_url = sprintf($alexa, urlencode($domain));
        $xml = simplexml_load_file($request_url);

        if (!isset($xml->SD[1])) {
            return false;
        }

        $nodeAttributes = $xml->SD[1]->POPULARITY->attributes();
        $text = (int) $nodeAttributes['TEXT'];

        return $text;
    }
51762
def url(self, url):
        
        if url is None:
            raise ValueError("Invalid value for `url`, must not be `None`")
        if url is not None and len(url) > 4096:
            raise ValueError("Invalid value for `url`, length must be less than or equal to `4096`")
        if url is not None and len(url) < 1:
            raise ValueError("Invalid value for `url`, length must be greater than or equal to `1`")
        if url is not None and not re.search('^https?:.*', url):
            raise ValueError("Invalid value for `url`, must be a follow pattern or equal to `/^https?:.*/`")

        self._url = url
731341
def show_company(domain):
    '''
    
    '''
    data = __utils__['http.query'](
        '{0}/companies/domain/{1}'.format(_base_url(), domain),
        status=True,
        decode=True,
        decode_type='json',
        header_dict={
            'tppl-api-key': _api_key(),
        },
    )
    status = data['status']
    if six.text_type(status).startswith('4') or six.text_type(status).startswith('5'):
        raise CommandExecutionError(
            'There was an API error: {0}'.format(data['error'])
        )
    return data.get('dict', {})