def default(self, obj):
        if hasattr(obj, 'tojson'):
            # handle the Model instances
            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