def add_tag(plugin_id, tag):
    with db.common.connect() as con:
        if r.table('tags').get(tag).run(con) is None:
            r.table('tags').insert({
                'tag': tag,
                'plugins': [plugin_id]
            }).run(con)
        else:
            r.table('tags').get(tag).update(
                {'plugins': r.row['plugins'] + [plugin_id]}
            ).run(con)
Add all tags to relevant lists.
dataset/ETHPy150Open starcraftman/new-awesome/db/tags.py/add_tag