def prepare_metric(self, name, type, metric, keys, snapshot_keys=[]):
        base_name = re.sub(r"\s+", "_", name)
        if self.prefix:
            base_name = "{0}.{1}".format(self.prefix, base_name)

        time = now()
        type = "gauge" if type != "counter" else "counter"

        if self.filters:
            keys = filter(lambda key: key in self.filters, keys)
            snapshot_keys = filter(lambda key: self.filters in key, snapshot_keys)

        if self.excludes:
            keys = filter(lambda key: key not in self.excludes, keys)
            snapshot_keys = filter(lambda key: key in self.excludes, snapshot_keys)

        for name in keys:
            value = getattr(metric, name)
            yield type, {
                "name": "{0}.{1}".format(base_name, name),
                "source": self.source,
                "time": time,
                "value": value
            }

        if hasattr(metric, 'snapshot'):
            snapshot = metric.snapshot
            for name in snapshot_keys:
                value = getattr(snapshot, name)
                yield type, {
                    "name": "{0}.{1}".format(base_name, name),
                    "source": self.source,
                    "time": time,
                    "value": value
                }
dataset/ETHPy150Open cyberdelia/metrology/metrology/reporter/librato.py/LibratoReporter.prepare_metric/swapped operands of `in`