def json(self):
        """Serializes data. Non-serializable outputs are replaced with
        "NOT_SERIALIZABLE".
        """
        json_data = {}

        for item in self.iteritems():
            try:
                value = item.get_value(json_serializable=True)
            except __HOLE__:
                value = "NOT_SERIALIZABLE"
            item_data = {
                "tags": list(item.tags),
                "value": value,
            }
            if item.name in json_data:
                json_data[item.name].append(item_data)
            else:
                json_data[item.name] = [item_data]

        return json_data
dataset/ETHPy150Open impactlab/eemeter/eemeter/meter/base.py/DataCollection.json