def patched_to_marshallable_type(obj):
    if obj is None:
        return None  # make it idempotent for None

    if hasattr(obj, '__getitem__'):
        return obj  # it is indexable it is ok

    if hasattr(obj, '__marshallable__'):
        return obj.__marshallable__()

    return dict(obj.__dict__)
adds __marshallable__ support; see https://github.com/twilio/flask-restful/pull/32
dataset/ETHPy150Open fusic-com/flask-todo/utils/flaskutils/restful.py/patched_to_marshallable_type