Returns all processing eras in dbs
193992
def listProcessingEras(self, processing_version=''):
        
        conn = self.dbi.connection()
        try:
            result = self.pelst.execute(conn, processing_version)
            return result
        finally:
            if conn:
                conn.close()
240279
def all(cls, otp=False, ccid=False, u2f=False):
        """"""
        pids = set([
            cls.YUBIKEY,
            cls.NEO_OTP,
            cls.NEO_OTP_CCID,
            cls.NEO_CCID,
            cls.NEO_U2F,
            cls.NEO_OTP_U2F,
            cls.NEO_U2F_CCID,
            cls.NEO_OTP_U2F_CCID,
            cls.NEO_SKY,
            cls.YK4_OTP,
            cls.YK4_U2F,
            cls.YK4_OTP_U2F,
            cls.YK4_CCID,
            cls.YK4_OTP_CCID,
            cls.YK4_U2F_CCID,
            cls.YK4_OTP_U2F_CCID,
            cls.PLUS_U2F_OTP
        ])

        if otp:
            pids.difference_update(set([
                cls.NEO_CCID,
                cls.NEO_U2F,
                cls.NEO_U2F_CCID,
                cls.NEO_SKY,
                cls.YK4_U2F,
                cls.YK4_CCID,
                cls.YK4_U2F_CCID
            ]))

        if ccid:
            pids.difference_update(set([
                cls.YUBIKEY,
                cls.NEO_OTP,
                cls.NEO_U2F,
                cls.NEO_OTP_U2F,
                cls.NEO_SKY,
                cls.YK4_OTP,
                cls.YK4_U2F,
                cls.YK4_OTP_U2F,
                cls.PLUS_U2F_OTP
            ]))

        if u2f:
            pids.difference_update(set([
                cls.YUBIKEY,
                cls.NEO_OTP,
                cls.NEO_OTP_CCID,
                cls.NEO_CCID,
                cls.YK4_OTP,
                cls.YK4_CCID,
                cls.YK4_OTP_CCID
            ]))

        return pids
1075327
def _get_all_indexes(self):
        """"""
        if self.parser:
            return [v.index for v in self.parser.get_volumes()] + [d.index for d in self.parser.disks]
        else:
            return None
1367322
def get_processing_block_ids(self):
        """"""

        # Initialise empty list
        _processing_block_ids = []

        # Pattern used to search processing block ids
        pattern = '*:processing_block:*'
        block_ids = self._db.get_ids(pattern)

        for block_id in block_ids:
            id_split = block_id.split(':')[-1]
            _processing_block_ids.append(id_split)
        return sorted(_processing_block_ids)
325852
function processVersionLists (entity, version, versions) {
  quantum.select(entity)
    .selectAll('versionList', {recursive: true})
    .forEach(versionList => {
      versionList.content(versions.map(v => {
        return { type: 'version', params: [v], content: [] }
      }))
      versionList.add({ type: 'current', params: [version], content: [] })
    })
}
60870
def prune_database():
    
    now = datetime.now()
    expired = TokenBlacklist.query.filter(TokenBlacklist.expires < now).all()
    for token in expired:
        db.session.delete(token)
    db.session.commit()
1004887
def ReadFlowProcessingRequests(self, cursor=None):
    """"""
    query = ("SELECT request, UNIX_TIMESTAMP(timestamp) "
             "FROM flow_processing_requests")
    cursor.execute(query)

    res = []
    for serialized_request, ts in cursor.fetchall():
      req = rdf_flows.FlowProcessingRequest.FromSerializedString(
          serialized_request)
      req.timestamp = mysql_utils.TimestampToRDFDatetime(ts)
      res.append(req)
    return res
589110
def get_all_query_traces(self, max_wait_per=None, query_cl=ConsistencyLevel.LOCAL_ONE):
        
        if self._query_traces:
            return [self._get_query_trace(i, max_wait_per, query_cl) for i in range(len(self._query_traces))]
        return []
684988
def getProcessDatabase(self):
        
        info_dict = {}
        cur = self._conn.cursor()
        cur.execute("""SHOW FULL PROCESSLIST;""")
        rows = cur.fetchall()
        if rows:
            for row in rows:
                db = row[3]
                info_dict[db] = info_dict.get(db, 0) + 1
        return info_dict
166760
def all_dbs(self):
        
        url = '/'.join((self.server_url, '_all_dbs'))
        resp = self.r_session.get(url)
        resp.raise_for_status()
        return response_to_json_dict(resp)
862079
private function show_all()
    {
        $query = "SELECT expires, body FROM cache";
        if ($result = $this->db->query($query)) {
            if ($result->size() > 0) {
                $results = $result->fetchAll();
                echo '<pre>';
                print_r($results);
                echo '</pre>';
            } else {
                return false;
            }
        } else {
            // TODO: Handle error
            return false;
        }
    }
716931
def _retrieve(self, namespace, stream, start_id, end_time, order, limit,
                configuration):
    
    start_id_event = Event(start_id)
    end_id_event = Event(uuid_from_kronos_time(end_time,
                                               _type=UUIDType.HIGHEST))
    stream_events = self.db[namespace][stream]

    # Find the interval our events belong to.
    lo = bisect.bisect_left(stream_events, start_id_event)
    if lo + 1 > len(stream_events):
      return
    if stream_events[lo] == start_id_event:
      lo += 1
    hi = bisect.bisect_right(stream_events, end_id_event)

    if order == ResultOrder.DESCENDING:
      index_it = xrange(hi - 1, lo - 1, -1)
    else:
      index_it = xrange(lo, hi)

    for i in index_it:
      if limit <= 0:
        break
      limit -= 1
      yield marshal.dumps(stream_events[i])
1158147
def procedures
      return [] unless databases.any? || archives.any?

      [-> { prepare! }, databases, archives,
       -> { package! }, -> { store! }, -> { clean! }]
    end
1089266
def _process(self, startblock):
        """"""
        log.debug("Processing blocks %d to %d" % (startblock, startblock + BATCH_SIZE))

        addresses = []

        for blockNum in range(startblock, startblock + BATCH_SIZE):
            block_hash = self.db.reader._get_block_hash(blockNum)
            if block_hash is not None:
                receipts = self.db.reader._get_block_receipts(block_hash, blockNum)

                for receipt in receipts:
                    if receipt.contractAddress is not None and not all(
                        b == 0 for b in receipt.contractAddress
                    ):
                        addresses.append(receipt.contractAddress)
            else:
                if len(addresses) == 0:
                    raise Exception()

        return addresses
295383
def per_system_data(self):
        
        ret = {}
        for cache_date in self.cache_dates:
            data = self._cache_get(cache_date)
            ret[cache_date] = {
                self._column_value(x): data['by_system'][x]
                for x in data['by_system']
            }
            if len(ret[cache_date]) == 0:
                ret[cache_date]['unknown'] = 0
        return ret
460313
def lookup_hash_prefix(self, cues):
        
        q = '''SELECT value, MAX(negative_expires_at < current_timestamp) AS negative_cache_expired
                FROM hash_prefix WHERE cue IN ({}) GROUP BY 1
        '''
        output = []
        with self.get_cursor() as dbc:
            dbc.execute(q.format(','.join(['?'] * len(cues))), [sqlite3.Binary(cue) for cue in cues])
            for h in dbc.fetchall():
                value, negative_cache_expired = h
                output.append((bytes(value), negative_cache_expired))
        return output
715656
def versions(self):
        
        if self._versions is None:
            with self.database.cursor_autocommit() as cursor:
                query = """
                SELECT number,
                       date_start,
                       date_done,
                       log,
                       addons
                FROM {}
                """.format(self.table_name)
                cursor.execute(query)
                rows = cursor.fetchall()
                versions = []
                for row in rows:
                    row = list(row)
                    # convert 'addons' to json
                    row[4] = json.loads(row[4]) if row[4] else []
                    versions.append(
                        self.VersionRecord(*row)
                    )
                self._versions = versions
        return self._versions