def find_records(self, check, keys=None):
        if keys:
            bad_keys = [ key for key in keys if key not in self._keys ]
            if bad_keys:
                raise KeyError("Bad record key(s): %s"%bad_keys)
        
        if keys:
            # ensure msg_id is present and first:
            if 'msg_id' in keys:
                keys.remove('msg_id')
            keys.insert(0, 'msg_id')
            req = ', '.join(keys)
        else:
            req = '*'
        expr,args = self._render_expression(check)
        query = """SELECT %s FROM %s WHERE %s"""%(req, self.table, expr)
        cursor = self._db.execute(query, args)
        matches = cursor.fetchall()
        records = []
        for line in matches:
            rec = self._list_to_dict(line, keys)
            records.append(rec)
        return records
Return a unique ID such that it could be reused again.
dataset/ETHPy150Open ipython/ipython-py3k/IPython/parallel/controller/sqlitedb.py/SQLiteDB.find_records--crossover with--dataset/ETHPy150Open rapyuta/rce/rce-core/rce/core/network.py/Endpoint.returnUID