Internal function to get all the records for one zone and cache the data
551248
protected function fetchRecords($zone)
    {
        if (!$zone) {
            throw new \Exception('fetchRecords called with blank zone');
        }
        $uri = $this->baseuri.'/accounts/'.$this->account.'/zones/'.$zone.'/rr';
        $result = $this->httpGet($uri);

        return $result;
    }
857447
def list_records(self, domain, limit=None, offset=None):
        
        return domain.list_records(limit=limit, offset=offset)
752290
def cache_data(self, request, data, key='params'):
        
        request.session['%s:%s' % (constants.SESSION_KEY, key)] = data
398710
function getRecordSetsAndDomains(result, callback) {
      HostedZoneId = result.HostedZones.find(i=>i.Name === `${domain}.`).Id
      parallel({
        apis(callback) {
          gateway.getDomainNames({
            limit: 500,
          }, callback)
        },
        records(callback) {
          route53.listResourceRecordSets({
            HostedZoneId,
          }, callback)
        }
      }, callback)
    }
1111613
def delete_records(self, zone_name, record_type, subdomain):
        
        records = self._client.get('/domain/zone/{}/record'.format(zone_name),
                                   fieldType=record_type, subDomain=subdomain)
        for record in records:
            self.delete_record(zone_name, record)
799617
def records(self, domain, params=None):
        ''' 
        '''
        params = update_params(params, {'domain': domain})
        return self.request('/v1/dns/records', params, 'GET')
562526
def list_records(self, rtype=None, name=None, content=None):
        """"""
        opts = {}
        if rtype is not None:
            opts['type'] = rtype.upper()
        if name is not None:
            opts['name'] = self._relative_name(name)
        if content is not None:
            opts['value'] = self._txt_encode(content) if opts.get(
                'type', '') == 'TXT' else content

        records = []
        payload = self._api.domain.zone.record.list(
            self._api_key, self._zone_id, 0, opts)
        for record in payload:
            processed_record = {
                'type': record['type'],
                'name': self._full_name(record['name']),
                'ttl': record['ttl'],
                'content': record['value'],
                'id': record['id']
            }

            # Gandi will add quotes to all TXT record strings
            if processed_record['type'] == 'TXT':
                processed_record['content'] = self._txt_decode(
                    processed_record['content'])

            records.append(processed_record)

        LOGGER.debug("list_records: %s", records)
        return records
631110
def cache_data(self):
        
        # Set Slug if not set
        if not self.slug_name:
            self.slug_name = slugify(self.name).strip()
            if len(self.slug_name) > 255:
                self.slug_name = self.slug_name[0:254]
418533
protected function getListZone()
    {
        $conditions = $this->query_filter;
        $conditions['limit'] = $this->data_limit;

        return $this->zone->getList($conditions);
    }
227471
def _list_records(self, rtype=None, name=None, content=None):
        
        with self._session(self.domain, self.domain_id) as ddata:
            name = self._fqdn_name(name) if name else None
            return self._list_records_in_zone(ddata['zone']['data'], rtype, name, content)
715729
def atlasdb_cache_zonefile_info( con=None, path=None ):
    
    global ZONEFILE_INV, NUM_ZONEFILES, ZONEFILE_INV_LOCK
    
    inv = None
    with ZONEFILE_INV_LOCK:
        inv_len = atlasdb_zonefile_inv_length( con=con, path=path )
        inv = atlas_make_zonefile_inventory( 0, inv_len, con=con, path=path )

        ZONEFILE_INV = inv
        NUM_ZONEFILES = inv_len

    return inv
903944
def _cached(self, dbname, coll, index):
        """"""
        cache = self.__index_cache
        now = datetime.datetime.utcnow()
        with self.__index_cache_lock:
            return (dbname in cache and
                    coll in cache[dbname] and
                    index in cache[dbname][coll] and
                    now < cache[dbname][coll][index])
42314
async def all(
            self, *, details: bool = False,
            include_inactive: bool = False) -> list:
        """"""
        endpoint = 'zone'
        if details:
            endpoint += '/properties'
        data = await self._request('get', endpoint)
        return [z for z in data['zones'] if include_inactive or z['active']]
338954
def cache_all(self):
        """"""

        respond = input(
              'By default, cppman fetches pages on-the-fly if corresponding '
              'page is not found in the cache. The "cache-all" option is only '
              'useful if you want to view man pages offline. '
              'Caching all contents will take several minutes, '
              'do you want to continue [y/N]? ')
        if not (respond and 'yes'.startswith(respond.lower())):
            raise KeyboardInterrupt

        try:
            os.makedirs(environ.cache_dir)
        except:
            pass

        self.success_count = 0
        self.failure_count = 0

        if not os.path.exists(environ.index_db):
            raise RuntimeError("can't find index.db")

        conn = sqlite3.connect(environ.index_db)
        cursor = conn.cursor()

        source = environ.config.source
        print('Caching manpages from %s ...' % source)
        data = cursor.execute('SELECT * FROM "%s"' % source).fetchall()

        for name, url, _ in data:
            print('Caching %s ...' % name)
            retries = 3
            while retries > 0:
                try:
                    self.cache_man_page(source, url, name)
                except Exception:
                    print('Retrying ...')
                    retries -= 1
                else:
                    self.success_count += 1
                    break
            else:
                print('Error caching %s ...' % name)
                self.failure_count += 1

        conn.close()

        print('\n%d manual pages cached successfully.' % self.success_count)
        print('%d manual pages failed to cache.' % self.failure_count)
        self.update_mandb(False)
1097434
function dumpDatabase(db, allzones) {
  var sources = db.getSources();
  for (var n = 0; n < sources.length; n++) {
    util.logContextInfo(sources[n].getContextInfo());
  }

  var zones = db.getZones();
  if (!zones.length) {
    console.log('No zones');
    return 0;
  }

  var count = allzones ? zones.length : 1;
  for (var i = 0; i < count; ++i) {
    var zone = zones[i];
    var eventList = zone.getEventList();
    var it = eventList.begin();
    for (; !it.done(); it.next()) {
      util.logEvent(it, zone);
    }

  }
  return 0;
}
764820
def _build_cache():
    """"""
    query = current_app.config['COLLECTIONS_DELETED_RECORDS']
    for collection in Collection.query.filter(
            Collection.dbquery.isnot(None)).all():
        yield collection.name, dict(
            query=query.format(dbquery=collection.dbquery),
            ancestors=set(_ancestors(collection)),
        )
    raise StopIteration
532607
def get_all(self):
        
        self._lock.acquire()
        try:
            return list(self._cache.values())
        finally:
            self._lock.release()