def _class_count(objects):
    """List the most common object classes"""

    totals = {}
    for obj in objects:
        try:
            cls = obj.__class__
        except __HOLE__:
            cls = type(obj)
        name =  "%s.%s" % (cls.__module__, cls.__name__)
        try:
            totals[name].append(obj)
        except KeyError:
            totals[name] = [obj]

    totals = totals.items()
    totals.sort(lambda a,b: cmp(len(a[1]),len(b[1])))
    totals = totals[-20:] # Is this a reasonable filter?
    return totals
dataset/ETHPy150Open marineam/nagcat/python/nagcat/monitor_api.py/_class_count