Provide information about supplied domain as specified by the response group
        :param domain: Any valid URL
        :param response_group: Any valid urlinfo response group
        :return: Traffic and/or content data of the domain in XML format
970136
def urlinfo(self, domain, response_group = URLINFO_RESPONSE_GROUPS):
        '''
        
        '''
        params = {
            'Action': "UrlInfo",
            'Url': domain,
            'ResponseGroup': response_group
        }

        url, headers = self.create_v4_signature(params)
        return self.return_output(url, headers)
511310
def whois_domains_history(self, domains):
        
        api_name = 'opendns-whois-domain-history'
        fmt_url_path = u'whois/{0}/history'
        return self._multi_get(api_name, fmt_url_path, domains)
281857
def fetch(self):
        
        return self.domain._record(self.doapi_manager.request(self.url)\
                                                             ["domain_record"])
396944
def domain_whois_history(self, domain, limit=None):
        ''''''

        params = dict()
        if limit is not None:
            params['limit'] = limit

        uri = self._uris["whois_domain_history"].format(domain)
        resp_json = self.get_parse(uri, params)
        return resp_json
385990
def protection_domains(self):
        
        self.connection._check_login()
        response = self.connection._do_get("{}/{}".format(self.connection._api_url, "types/ProtectionDomain/instances")).json()
        all_pds = []
        for pd in response:
            all_pds.append(
                SIO_Protection_Domain.from_dict(pd)
            )
        return all_pds
643066
def authentication(self):
        '''
        
        '''
        url = '%s/authentication' % (self.domain)
        res = self.session.get(url)
        self._check_response(res)
        return res.json()
611881
def security(self, domains):
        
        api_name = 'opendns-security'
        fmt_url_path = u'security/name/{0}.json'
        return self._multi_get(api_name, fmt_url_path, domains)
1354504
def domain_add(self, domain, description=DESCRIPTION):
        
        data = {"domain": domain,
                "description": description}
        url = self.build_full_url(self.DOMAINS)
        return self.create_resource(url, data)
1179046
def check_many(self, domains):
        
        return dict((item.domain, item.status) for item in self.check_domain_request(domains))
511290
def list_domains(custom_headers:nil)
      response = list_domains_async(custom_headers:custom_headers).value!
      response.body unless response.nil?
    end
1089894
def query_domain(self, domain, typenames, domainquerytype='list', count=False):
        

        objects = self._get_repo_filter(Layer.objects)

        if domainquerytype == 'range':
            return [tuple(objects.aggregate(Min(domain), Max(domain)).values())]
        else:
            if count:
                return [(d[domain], d['%s__count' % domain])
                        for d in objects.values(domain).annotate(Count(domain))]
            else:
                return objects.values_list(domain).distinct()
321364
def process_request(self, request):
        
        domain, host = map(lower,
            (self.get_domain_for_request(request), request.get_host()))

        pattern = r'^(?:(?P<subdomain>.*?)\.)?%s(?::.*)?$' % re.escape(domain)
        matches = re.match(pattern, host)

        if matches:
            request.subdomain = matches.group('subdomain')
        else:
            request.subdomain = None
            logger.warning('The host %s does not belong to the domain %s, '
                'unable to identify the subdomain for this request',
                request.get_host(), domain)
1116024
def get_domains(self):
        
        url = self.API_TEMPLATE + self.DOMAINS
        data = self._get_json_from_response(url)

        domains = list()
        for item in data:
            domain = item['domain']
            domains.append(domain)
            self.logger.debug('Discovered domains: {}'.format(domain))

        return domains
193768
def __parse_domain_to_employer_line(self, raw_domain, raw_org):
        """"""

        d = re.match(self.DOMAIN_REGEX, raw_domain, re.UNICODE)
        if not d:
            cause = "invalid domain format: '%s'" % raw_domain
            raise InvalidFormatError(cause=cause)

        dom = d.group('domain').strip()

        o = re.match(self.ORGANIZATION_REGEX, raw_org, re.UNICODE)
        if not o:
            cause = "invalid organization format: '%s'" % raw_org
            raise InvalidFormatError(cause=cause)

        org = o.group('organization').strip()

        org = self.__encode(org)
        dom = self.__encode(dom)

        return org, dom
25241
def get_server_info(self):
        
        response = self.get_proto(path='')
        message = rest_pb2.GetApiOverviewResponse()
        message.ParseFromString(response.content)
        return ServerInfo(message)
666280
def extract_domain(host):
    
    host = re.sub('https?://', '', host)
    host = re.match('([^/]+)', host).groups()[0]
    domain = '.'.join(host.split('.')[-2:])
    if domain in _domains:
        domain = '.'.join(host.split('.')[-3:])
    return domain
583296
def GET_subdomains( self, path_info ):
        
        qs_values = path_info['qs_values']
        page = qs_values.get('page', None)
        if page is None:
            log.error("Page required")
            return self._reply_json({'error': 'page= argument required'}, status_code=400)

        try:
            page = int(page)
            assert page >= 0
        except Exception:
            log.error("Invalid page")
            return self._reply_json({'error': 'Invalid page= value'}, status_code=400)

        offset = page * 100
        count = 100

        blockstackd_url = get_blockstackd_url()
        res = blockstackd_client.get_all_subdomains(offset, count, hostport=blockstackd_url)

        if json_is_error(res):
            log.error("Failed to list all subdomains (offset={}, count={}): {}".format(offset, count, res['error']))
            return self._reply_json({'error': 'Failed to list all names'}, status_code=res.get('http_status', 406))

        return self._reply_json(res)