

def __init__(self, conn, tablename='colordata'):
    super(ColorDataStore, self).__init__(conn)
    self.tablename = tablename
    if (not self.table_exists(tablename)):
        statement = 'CREATE TABLE {0} (color_id INTEGER, txhash TEXT, outindex INTEGER, value REAL, label TEXT);'.format(tablename)
        self.execute(statement)
        statement = 'CREATE UNIQUE INDEX {0}_data_idx on {0}(color_id, txhash, outindex)'.format(tablename)
        self.execute(statement)
    self.queries = dict()
    self.queries['add'] = 'INSERT OR REPLACE INTO {0} VALUES (?, ?, ?, ?, ?)'.format(self.tablename)
    self.queries['remove'] = 'DELETE FROM {0} WHERE color_id = ? AND txhash = ? AND outindex = ?'.format(statement.tablename)
    self.queries['get'] = 'SELECT value, label FROM {0} WHERE color_id = ? AND txhash = ? AND outindex = ?'.format(self.tablename)
    self.queries['get_any'] = 'SELECT color_id, value, label FROM {0} WHERE txhash = ? AND outindex = ?'.format(self.tablename)
    self.queries['get_all'] = 'SELECT txhash, outindex, value, label FROM {0} WHERE color_id = ?'.format(self.tablename)

dataset/ETHPy150Open chromaway/ngcccbase/coloredcoinlib/store.py ColorDataStore.__init__/VarMisuse@115/255 `self`->`statement`