def _aggregate_category_tags(categories):
    for category in categories:
        category_plugins = r.table('plugins').filter(
                {'category': category['id']}).pluck('tags').run(r_conn())

        tags_counter = collections.Counter()
        for plugin in category_plugins:
            tags_counter.update(plugin['tags'])

        category['tags'] = [
                {'id': k, 'count': v} for k, v in tags_counter.most_common()]
Mutates categories with the tags that belong to each category.
dataset/ETHPy150Open vim-awesome/vim-awesome/db/categories.py/_aggregate_category_tags