def jsonify(obj):
    def handler(obj):
        if hasattr(obj, 'isoformat'):
            return obj.isoformat()
        if hasattr(obj, 'todict'):
            return obj.todict()
        else:
            raise TypeError((type(obj), repr(obj)) % 'Object of type %s with value of %s is not JSON serializable')
    return json.dumps(obj, default=handler)
dataset/ETHPy150Open priestc/giotto/giotto/utils.py/jsonify/swapped operands of `%`