Region's World Factbook Entry.

        Returns
        -------
        an :class:`ApiQuery` of str
3638
async def factbook(self, root):
        
        # This lib might have been a mistake, but the line below
        # definitely isn't.
        return html.unescape(html.unescape(root.find('FACTBOOK').text))
1195620
def get_world_bbox(self):
        
        return BBox((-self.POP_WEB_MAX, -self.POP_WEB_MAX, self.POP_WEB_MAX, self.POP_WEB_MAX), crs=CRS.POP_WEB)
778733
def _getGlobals(self, **kwargs):
        
        # Default globals
        globs = {
            "__builtins__": None,
            "all": all,
            "any": any,
            "bool": bool,
            "chr": chr,
            "cmp": cmp,
            "complex": complex,
            "divmod": divmod,
            "enumerate": enumerate,
            "float": float,
            "format": format,
            "frozenset": frozenset,
            "hex": hex,
            "int": int,
            "len": len,
            "list": list,
            "long": long,
            "math": math,
            "max": max,
            "min": min,
            "oct": oct,
            "ord": ord,
            "pow": pow,
            "range": range,
            "reversed": reversed,
            "round": round,
            "str": str,
            "sum": sum,
            "tuple": tuple,
            "xrange": xrange,
        }
        # Update with keyword arguments
        globs.update(kwargs)
        # Update with additional Python libraries
        for imp in self.getPythonImports():
            mod = imp["module"]
            func = imp["function"]
            member = self._getModuleMember(mod, func)
            if member is None:
                raise ImportError(
                    "Could not find member {} of module {}".format(
                        func, mod))
            globs[func] = member
        return globs
285647
def get_all_regions(self):
        '''
        
        '''
        if (time() - self.regions_last_update) < self.regions_update_time:
            return self.regions_last_request

        response = self.call_api(self.all_regions_path)
        regions = []
        for location in response['Locations']['Location']:
            region = Site()
            region.id = location['@id']
            region.region = location['@name']
            region.name = REGION_NAMES[location['@name']]
            regions.append(region)

        self.regions_last_update = time()
        self.regions_last_request = regions
        return regions
250166
def regions():
    
    return [SQSRegionInfo(name='us-east-1',
                          endpoint='sqs.us-east-1.amazonaws.com'),
            SQSRegionInfo(name='eu-west-1',
                          endpoint='sqs.eu-west-1.amazonaws.com'),
            SQSRegionInfo(name='us-west-1',
                          endpoint='sqs.us-west-1.amazonaws.com'),
            SQSRegionInfo(name='us-west-2',
                          endpoint='sqs.us-west-2.amazonaws.com'),
            SQSRegionInfo(name='sa-east-1',
                          endpoint='sqs.sa-east-1.amazonaws.com'),
            SQSRegionInfo(name='ap-northeast-1',
                          endpoint='sqs.ap-northeast-1.amazonaws.com'),
            SQSRegionInfo(name='ap-southeast-1',
                          endpoint='sqs.ap-southeast-1.amazonaws.com')
            ]
599829
def get_geo_region(self, ip):
        
        query_parameters = {}
        if ip is not None:
            query_parameters['ip'] = self._serialize.query('ip', ip, 'str')
        response = self._send(http_method='GET',
                              location_id='35b3ff1d-ab4c-4d1c-98bb-f6ea21d86bd9',
                              version='5.1-preview.1',
                              query_parameters=query_parameters)
        return self._deserialize('GeoRegion', response)
518608
def get_info(self, version):
        
        ret = super(PandasStore, self).get_info(version)
        ret['col_names'] = version['dtype_metadata']
        ret['handler'] = self.__class__.__name__
        ret['dtype'] = ast.literal_eval(version['dtype'])
        return ret
650280
def get_countries(self):
        
        qs = Venue.objects.values('country') \
                                    .exclude(country='') \
                                    .distinct() \
                                    .order_by('country')

        countries = []

        for c in qs:
            countries.append({
                'code': c['country'],
                'name': Venue.get_country_name(c['country'])
            })

        return sorted(countries, key=lambda k: k['name'])
1178717
def countries(self):
        
        if not hasattr(self, "_countries"):
            only = self.get_option("only")
            if only:
                only_choices = True
                if not isinstance(only, dict):
                    for item in only:
                        if isinstance(item, six.string_types):
                            only_choices = False
                            break
            if only and only_choices:
                self._countries = dict(only)
            else:
                # Local import so that countries aren't loaded into memory
                # until first used.
                from django_countries.data import COUNTRIES

                self._countries = dict(COUNTRIES)
                if self.get_option("common_names"):
                    self._countries.update(self.COMMON_NAMES)
                override = self.get_option("override")
                if override:
                    self._countries.update(override)
                    self._countries = dict(
                        (code, name)
                        for code, name in self._countries.items()
                        if name is not None
                    )
            if only and not only_choices:
                countries = {}
                for item in only:
                    if isinstance(item, six.string_types):
                        countries[item] = self._countries[item]
                    else:
                        key, value = item
                        countries[key] = value
                self._countries = countries
            self.countries_first = []
            first = self.get_option("first") or []
            for code in first:
                code = self.alpha2(code)
                if code in self._countries:
                    self.countries_first.append(code)
        return self._countries
273929
def query(self):
        
        tree = pypeg2.parse(self._query, parser(), whitespace="")
        for walker in query_walkers():
            tree = tree.accept(walker)
        return tree
1254929
def countries(instance):
    
    if (instance['type'] == 'location' and 'country' in instance and not
            instance['country'].upper() in enums.COUNTRY_CODES):

        return JSONError("Location `country` should be a valid ISO 3166-1 "
                         "ALPHA-2 Code.",
                         instance['id'], 'marking-definition-type')
1143005
def log_entries(self, time_zone='UTC', is_overview=False,
                    include=None, fetch_all=True):
        """"""
        endpoint = '/'.join((self.endpoint, self.id, 'log_entries'))

        query_params = {
            'time_zone': time_zone,
            'is_overview': json.dumps(is_overview),
        }

        if include:
            query_params['include'] = include

        result = self.logEntryFactory.find(
            endpoint=endpoint,
            api_key=self.api_key,
            fetch_all=fetch_all,
            **query_params
        )

        return result
332396
def get_regions(self):
        
        response = self._send(http_method='GET',
                              location_id='b129ca90-999d-47bb-ab37-0dcf784ee633',
                              version='5.1-preview.1')
        return self._deserialize('ProfileRegions', response)
1202805
async def description(self):
        
        resp = await self._call_web(f'nation={self.id}')
        return html.unescape(
            re.search(
                '<div class="nationsummary">(.+?)<p class="nationranktext">',
                resp.text,
                flags=re.DOTALL
            )
            .group(1)
            .replace('\n', '')
            .replace('</p>', '')
            .replace('<p>', '\n\n')
            .strip()
        )
401458
def get_stats(self):
        
        try:
            query = {
                # We only care about the aggregations, so don't return the hits
                'size': 0,
                'aggs': {
                    'num_packages': {
                        'value_count': {
                            'field': 'id',
                        },
                    },
                    'num_records': {
                        'sum': {
                            'field': 'package.count_of_rows',
                        },
                    },
                    'num_countries': {
                        'cardinality': {
                            'field': 'package.countryCode.keyword',
                        },
                    },
                },
            }
            aggregations = self.es.search(index=self.index_name,
                                          body=query)['aggregations']

            return {
                key: int(value['value'])
                for key, value in aggregations.items()
            }
        except NotFoundError:
            return {}
92200
def _get_regions(self):
        """"""
        if self._specs_in[_REGIONS_STR] == 'all':
            return [_get_all_objs_of_type(
                Region, getattr(self._obj_lib, 'regions', self._obj_lib)
            )]
        else:
            return [set(self._specs_in[_REGIONS_STR])]
502280
def lookups(self, request, model_admin):
        
        list_of_countries = []

        # We don't need the country_count but we need to annotate them in order
        # to group the results.
        qs = Venue.objects.exclude(country='') \
                            .values('country') \
                            .annotate(country_count=Count('country')) \
                            .order_by('country')
        for obj in qs:
            country = obj['country']
            list_of_countries.append(
                (country, Venue.COUNTRIES[country])
            )

        return sorted(list_of_countries, key=lambda c: c[1])