def add(self, key, metric):
        class_map = { 
           Histogram: self._histograms,
           Meter: self._meters,
           Gauge: self.gauges,
           Timer: self._timers,
           Counter: self._counters,
        }
        for cls, registry in class_map.iteritems():
            if isinstance(metric, cls):
                if key in registry:
                    raise LookupError("Metric %r already registered" % key)
                registry[key] = registry
                return
        raise TypeError("Invalid class. Could not register metric %r" % key)
Parse the MUC user extension element.
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/pyformance-0.3.2/pyformance/registry.py/MetricsRegistry.add--crossover with--dataset/ETHPy150Open ralphm/wokkel/wokkel/muc.py/UserPresence._childParser_mucUser