#!/usr/bin/env python

from gi.repository import Gio

SHELL_SCHEMA = "org.gnome.shell"
ENABLED_EXTENSIONS_KEY = "enabled-extensions"

settings = Gio.Settings.new(SHELL_SCHEMA)
uuids = settings.get_strv(ENABLED_EXTENSIONS_KEY)

duplicates = {}

for uuid in uuids:
    if not uuid in duplicates:
        duplicates[uuid] = 1
    else:
        duplicates[uuid] += 1

for uuid in duplicates:
    print('UUID "%s" occurence: %d' % (uuid, duplicates[uuid]))
