def default(self, obj):
        if hasattr(obj, 'json_repr'):
            return self.default(obj.json_repr(minimal=True))

        if isinstance(obj, datetime.datetime):
            return obj.isoformat()

        if isinstance(obj, collections.Iterable) and not is_stringy(obj):
            try:
                return {k: self.default(v) for k, v in obj.items() if (v or v in (False, 0))}
            except __HOLE__:
                return [self.default(e) for e in obj if (e or e in (False, 0))]

        return obj
dataset/ETHPy150Open thefactory/marathon-python/marathon/util.py/MarathonMinimalJsonEncoder.default