def date_default(obj):
    if isinstance(obj, datetime):
        return obj.isoformat()
    else:
        raise TypeError("%r is not JSON serializable"%obj)
default function for packing datetime objects in JSON.
dataset/ETHPy150Open jupyter/jupyter_client/jupyter_client/jsonutil.py/date_default