#NEWLINE# def iterencode( self , o , _one_shot = False ) : #NEWLINE# #INDENT# "The sole purpose of defining a custom JSONEncoder class is to\n        override floatstr() inner function, or more specifically the\n        representation of NaN and +/-float('inf') values in a JSON. Although\n        Infinity values are not supported by JSON standard, we still can\n        convince Javascript JSON.parse() to create a Javascript Infinity\n        object if we feed a token `1e+999` to it.\n        " #NEWLINE# if self . check_circular : #NEWLINE# #INDENT# markers = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# markers = None #NEWLINE# #UNINDENT# if self . ensure_ascii : #NEWLINE# #INDENT# _encoder = encoder . encode_basestring_ascii #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# _encoder = encoder . encode_basestring #NEWLINE# #UNINDENT# if ( six . PY2 and ( self . encoding != 'utf-8' ) ) : #NEWLINE# #INDENT# def _encoder( o , _orig_encoder = _encoder , _encoding = self . encoding ) : #NEWLINE# #INDENT# if isinstance ( o , str ) : #NEWLINE# #INDENT# o = o . decode ( _encoding ) #NEWLINE# #UNINDENT# return _orig_encoder ( o ) #NEWLINE# #UNINDENT# #UNINDENT# def floatstr( o , allow_nan = self . allow_nan , _repr = encoder . FLOAT_REPR , _inf = encoder . INFINITY , _neginf = ( - encoder . INFINITY ) ) : #NEWLINE# #INDENT# if ( o != o ) : #NEWLINE# #INDENT# text = self . nan_str #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( o == _inf ) : #NEWLINE# #INDENT# text = self . inf_str #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( o == _neginf ) : #NEWLINE# #INDENT# text = ( '-' + self . inf_str ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return _repr ( o ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( not allow_nan ) : #NEWLINE# #INDENT# raise ValueError ( ( _ ( 'Out of range float values are not JSON compliant: %r' ) % o ) ) #NEWLINE# #UNINDENT# return text #NEWLINE# #UNINDENT# _iterencode = json . encoder . _make_iterencode ( markers , floatstr . default , _encoder , self . indent , floatstr , self . key_separator , self . item_separator , self . sort_keys , self . skipkeys , _one_shot ) #NEWLINE# return _iterencode ( o , 0 )