def insert_keys(self, keys):
        start = 0
        bulk_insert = self.bulk_insert
        keys_len = len(keys)
        query = 'INSERT IGNORE INTO gauged_keys (namespace, `key`) VALUES '
        execute = self.cursor.execute
        while start < keys_len:
            rows = keys[start:start+bulk_insert]
            params = [param for params in rows for param in params]
            insert = '(%s,%s),' * (len(rows) - 1) + '(%s,%s)'
            execute(query + insert, params)
            start += bulk_insert
Insert keys into a table which assigns an ID
dataset/ETHPy150Open chriso/gauged/gauged/drivers/mysql.py/MySQLDriver.insert_keys