'Accept an object (of unknown type) and try to encode with priority:
1. builtin:     user-defined objects
2. sage:        sage math cloud
3. pandas:      dataframes/series
4. numpy:       ndarrays
5. datetime:    time/datetime objects
Each method throws a NotEncoded exception if it fails.
The default method will only get hit if the object is not a type that
is naturally encoded by json:
Normal objects:
dict                object
list, tuple         array
str, unicode        string
int, long, float    number
True                true
False               false
None                null
Extended objects:
float(\'nan\')        \'NaN\'
float(\'infinity\')   \'Infinity\'
float(\'-infinity\')  \'-Infinity\'
Therefore, we only anticipate either unknown iterables or values here.'

def default(self, obj):

    encoding_methods = (self.encode_as_plotly, self.encode_as_sage, self.encode_as_numpy, self.encode_as_pandas, self.encode_as_datetime, self.encode_as_date, self.encode_as_list, self.encode_as_decimal)
    for encoding_method in encoding_methods:
        try:
            return encoding_method(obj)
        except NotEncodable:
            pass
    return _json.JSONEncoder.default(self, obj)
