

def default(self, obj):
    if hasattr(obj, 'tojson'):
        return obj.tojson()
    if isinstance(obj, datetime):
        return {
            '__datetime__': totimestamp2(obj),
        }
    elif isinstance(obj, date):
        return {
            '__date__': totimestamp(obj),
        }
    elif isinstance(obj, Decimal):
        return {
            '__decimal__': str(obj),
        }
    elif (ndarray and isinstance(obj, ndarray)):
        return obj.tolist()
    else:
        return super(JSONDateDecimalEncoder, self).default(obj)

dataset/ETHPy150Open lsbardel/python-stdnet/stdnet/utils/jsontools.py JSONDateDecimalEncoder.default/original