

def resolve_color_desc(self, color_desc, auto_add):
    q = 'SELECT color_id FROM color_map WHERE color_desc = ?'
    res = self.execute(q, (color_desc,)).fetchone()
    if ((res is None) and auto_add):
        self.execute('INSERT INTO color_map(color_id, color_desc) VALUES (NULL, ?)', (color_desc,))
        self.sync()
        res = self.execute(q, (color_desc,)).fetchone()
    return unwrap1(res)

dataset/ETHPy150Open chromaway/ngcccbase/coloredcoinlib/store.py ColorMetaStore.resolve_color_desc/original