class_docstr: Extensible JSON <http://json.org> encoder for Python data structures.
  
  Supports the following objects and types by default:
  
  +-------------------+---------------+
  | Python            | JSON          |
  +===================+===============+
  | dict, namedtuple  | object        |
  +-------------------+---------------+
  | list, tuple       | array         |
  +-------------------+---------------+
  | str, unicode      | string        |
  +-------------------+---------------+
  | int, long, float  | number        |
  +-------------------+---------------+
  | True              | true          |
  +-------------------+---------------+
  | False             | false         |
  +-------------------+---------------+
  | None              | null          |
  +-------------------+---------------+
  
  To extend this to recognize other objects, subclass and implement a
  ``.default()`` method with another method that returns a serializable
  object for ``o`` if possible, otherwise it should call the superclass
  implementation (to raise ``TypeError``).
class_docstr_tok: ["Extensible","JSON","<","http",":","\/\/json.org",">","encoder","for","Python","data","structures",".","Supports","the","following","objects","and","types","by","default",":","+","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","-+","|","Python","|","JSON","|","+===================+===============+","|","dict",",","namedtuple","|","object","|","+","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","-+","|","list",",","tuple","|","array","|","+","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","-+","|","str",",","unicode","|","string","|","+","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","-+","|","int",",","long",",","float","|","number","|","+","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","-+","|","True","|","true","|","+","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","-+","|","False","|","false","|","+","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","-+","|","None","|","null","|","+","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","-+","To","extend","this","to","recognize","other","objects",",","subclass","and","implement","a","``",".default","(",")","``","method","with","another","method","that","returns","a","serializable","object","for","``","o","``","if","possible",",","otherwise","it","should","call","the","superclass","implementation","(","to","raise","``","TypeError","``",")","."]
docstr: Encode the given object and yield each string
  representation as available.
  
  For example::
  
      for chunk in JSONEncoder().iterencode(bigobject):
          mysocket.write(chunk)
docstr_tok: ["Encode","the","given","object","and","yield","each","string","representation","as","available",".","For","example",":",":","for","chunk","in","JSONEncoder","(",")",".iterencode","(","bigobject",")",":","mysocket.write","(","chunk",")"]
code: def iterencode(self, o, _one_shot=False):
      """Encode the given object and yield each string
      representation as available.
  
      For example::
  
          for chunk in JSONEncoder().iterencode(bigobject):
              mysocket.write(chunk)
  
      """
      if self.check_circular:
          markers = {}
      else:
          markers = None
      if self.ensure_ascii:
          _encoder = encode_basestring_ascii
      else:
          _encoder = encode_basestring
      if self.encoding != "utf-8" and self.encoding is not None:
  
          def _encoder(
              o, _orig_encoder=_encoder, _encoding=self.encoding
          ):
              if isinstance(o, binary_type):
                  o = text_type(o, _encoding)
              return _orig_encoder(o)
  
      def floatstr(
          o,
          allow_nan=self.allow_nan,
          ignore_nan=self.ignore_nan,
          _repr=FLOAT_REPR,
          _inf=PosInf,
          _neginf=-PosInf,
      ):
          # Check for specials. Note that this type of test is processor
          # and/or platform-specific, so do tests which don't depend on
          # the internals.
  
          if o != o:
              text = "NaN"
          elif o == _inf:
              text = "Infinity"
          elif o == _neginf:
              text = "-Infinity"
          else:
              if type(o) != float:
                  # See #118, do not trust custom str/repr
                  o = float(o)
              return _repr(o)
  
          if ignore_nan:
              text = "null"
          elif not allow_nan:
              raise ValueError(
                  "Out of range float values are not JSON compliant: "
                  + repr(o)
              )
  
          return text
  
      key_memo = {}
      int_as_string_bitcount = (
          53 if self.bigint_as_string else self.int_as_string_bitcount
      )
      if (
          _one_shot
          and c_make_encoder is not None
          and self.indent is None
      ):
          _iterencode = c_make_encoder(
              markers,
              self.default,
              _encoder,
              self.indent,
              self.key_separator,
              self.item_separator,
              self.sort_keys,
              self.skipkeys,
              self.allow_nan,
              key_memo,
              self.use_decimal,
              self.namedtuple_as_object,
              self.tuple_as_array,
              int_as_string_bitcount,
              self.item_sort_key,
              self.encoding,
              self.for_json,
              self.ignore_nan,
              decimal.Decimal,
              self.iterable_as_array,
          )
      else:
          _iterencode = _make_iterencode(
              markers,
              self.default,
              _encoder,
              self.indent,
              floatstr,
              self.key_separator,
              self.item_separator,
              self.sort_keys,
              self.skipkeys,
              _one_shot,
              self.use_decimal,
              self.namedtuple_as_object,
              self.tuple_as_array,
              int_as_string_bitcount,
              self.item_sort_key,
              self.encoding,
              self.for_json,
              self.iterable_as_array,
              Decimal=decimal.Decimal,
          )
      try:
          return _iterencode(o, 0)
      finally:
          key_memo.clear()
  
imports: from __future__ import absolute_import
  import re
  from operator import itemgetter
  import decimal
  from .compat import unichr, binary_type, text_type, string_types, integer_types, PY3
  from .decoder import PosInf
  from .raw_json import RawJSON
label_desc: Use image node_id 4 for calling the JSONEncoder obj's underlying member method code with example usage: obj.iterencode(o, _one_shot) and returns: text, _iterencode, _orig_encoder, _repr