def to_dictionary(self):
        """Serialize an object into dictionary form.  Useful if you have to
        serialize an array of objects into JSON.  Otherwise, if you call the
        :meth:`to_json` method on each object in the list and then try to
        dump the array, you end up with an array with one string."""

        j = {}
        for p in self.properties:
            try:
                v = getattr(self, p)
            except __HOLE__:
                continue
            if v is not None:
                if p == 't':
                    j[p] = getattr(self, p).isoformat()
                else:
                    j[p] = getattr(self, p)

        return j
dataset/ETHPy150Open tempodb/tempodb-python/tempodb/protocol/objects.py/DataPoint.to_dictionary