nodes: 0, module; 1, function_definition; 2, function_name:json_encode; 3, parameters; 4, block; 5, identifier:self; 6, identifier:out; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, for_statement; 14, identifier:limit; 15, None; 16, identifier:sort_keys; 17, False; 18, identifier:indent; 19, None; 20, string; 21, assignment; 22, assignment; 23, identifier:chunk; 24, call; 25, block; 26, string_content:Encode the results of this paged response as JSON writing to the
          provided file-like `out` object. This function will iteratively read
          as many pages as present, streaming the contents out as JSON.
  
          :param file-like out: an object with a `write` function
          :param int limit: optional maximum number of items to write
          :param bool sort_keys: if True, output keys sorted, default is False
          :param bool indent: if True, indent output, default is False; 27, identifier:stream; 28, call; 29, identifier:enc; 30, call; 31, attribute; 32, argument_list; 33, expression_statement; 34, attribute; 35, argument_list; 36, attribute; 37, argument_list; 38, identifier:enc; 39, identifier:iterencode; 40, identifier:stream; 41, call; 42, identifier:self; 43, identifier:_json_stream; 44, identifier:limit; 45, identifier:json; 46, identifier:JSONEncoder; 47, keyword_argument; 48, keyword_argument; 49, attribute; 50, argument_list; 51, identifier:indent; 52, identifier:indent; 53, identifier:sort_keys; 54, identifier:sort_keys; 55, identifier:out; 56, identifier:write; 57, binary_operator:u'%s' % chunk; 58, string; 59, identifier:chunk; 60, string_content:%s
code: def json_encode(self, out, limit=None, sort_keys=False, indent=None):
          '''Encode the results of this paged response as JSON writing to the
          provided file-like `out` object. This function will iteratively read
          as many pages as present, streaming the contents out as JSON.
  
          :param file-like out: an object with a `write` function
          :param int limit: optional maximum number of items to write
          :param bool sort_keys: if True, output keys sorted, default is False
          :param bool indent: if True, indent output, default is False
          '''
          stream = self._json_stream(limit)
          enc = json.JSONEncoder(indent=indent, sort_keys=sort_keys)
          for chunk in enc.iterencode(stream):
              out.write(u'%s' % chunk)