nodes: 0, module; 1, function_definition; 2, function_name:iter; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, dictionary_splat_pattern; 10, expression_statement; 11, assert_statement; 12, if_statement; 13, expression_statement; 14, while_statement; 15, identifier:offset; 16, integer:0; 17, identifier:count; 18, None; 19, identifier:pagesize; 20, None; 21, identifier:kwargs; 22, comment:"""Iterates over the collection.
  
          This method is equivalent to the :meth:`list` method, but
          it returns an iterator and can load a certain number of entities at a
          time from the server.
  
          :param offset: The index of the first entity to return (optional).
          :type offset: ``integer``
          :param count: The maximum number of entities to return (optional).
          :type count: ``integer``
          :param pagesize: The number of entities to load (optional).
          :type pagesize: ``integer``
          :param kwargs: Additional arguments (optional):
  
              - "search" (``string``): The search query to filter responses.
  
              - "sort_dir" (``string``): The direction to sort returned items:
                "asc" or "desc".
  
              - "sort_key" (``string``): The field to use for sorting (optional).
  
              - "sort_mode" (``string``): The collating sequence for sorting
                returned items: "auto", "alpha", "alpha_case", or "num".
  
          :type kwargs: ``dict``
  
          **Example**::
  
              import splunklib.client as client
              s = client.connect(...)
              for saved_search in s.saved_searches.iter(pagesize=10):
                  # Loads 10 saved searches at a time from the
                  # server.
                  ...
          """; 23, boolean_operator; 24, comparison_operator:count is None; 25, block; 26, assignment; 27, boolean_operator; 28, block; 29, comparison_operator:pagesize is None; 30, comparison_operator:pagesize > 0; 31, identifier:count; 32, None; 33, expression_statement; 34, identifier:fetched; 35, integer:0; 36, comparison_operator:count == self.null_count; 37, comparison_operator:fetched < count; 38, expression_statement; 39, expression_statement; 40, expression_statement; 41, expression_statement; 42, for_statement; 43, if_statement; 44, expression_statement; 45, expression_statement; 46, identifier:pagesize; 47, None; 48, identifier:pagesize; 49, integer:0; 50, assignment; 51, identifier:count; 52, attribute; 53, identifier:fetched; 54, identifier:count; 55, assignment; 56, assignment; 57, assignment; 58, augmented_assignment; 59, identifier:item; 60, identifier:items; 61, block; 62, boolean_operator; 63, block; 64, augmented_assignment; 65, call; 66, identifier:count; 67, attribute; 68, identifier:self; 69, identifier:null_count; 70, identifier:response; 71, call; 72, identifier:items; 73, call; 74, identifier:N; 75, call; 76, identifier:fetched; 77, identifier:N; 78, expression_statement; 79, comparison_operator:pagesize is None; 80, comparison_operator:N < pagesize; 81, break_statement; 82, identifier:offset; 83, identifier:N; 84, attribute; 85, argument_list; 86, identifier:self; 87, identifier:null_count; 88, attribute; 89, argument_list; 90, attribute; 91, argument_list; 92, identifier:len; 93, argument_list; 94, yield; 95, identifier:pagesize; 96, None; 97, identifier:N; 98, identifier:pagesize; 99, identifier:logging; 100, identifier:debug; 101, string:"pagesize=%d, fetched=%d, offset=%d, N=%d, kwargs=%s"; 102, identifier:pagesize; 103, identifier:fetched; 104, identifier:offset; 105, identifier:N; 106, identifier:kwargs; 107, identifier:self; 108, identifier:get; 109, keyword_argument; 110, keyword_argument; 111, dictionary_splat; 112, identifier:self; 113, identifier:_load_list; 114, identifier:response; 115, identifier:items; 116, identifier:item; 117, identifier:count; 118, boolean_operator; 119, identifier:offset; 120, identifier:offset; 121, identifier:kwargs; 122, identifier:pagesize; 123, identifier:count
code: def iter(self, offset=0, count=None, pagesize=None, **kwargs):
          """Iterates over the collection.
  
          This method is equivalent to the :meth:`list` method, but
          it returns an iterator and can load a certain number of entities at a
          time from the server.
  
          :param offset: The index of the first entity to return (optional).
          :type offset: ``integer``
          :param count: The maximum number of entities to return (optional).
          :type count: ``integer``
          :param pagesize: The number of entities to load (optional).
          :type pagesize: ``integer``
          :param kwargs: Additional arguments (optional):
  
              - "search" (``string``): The search query to filter responses.
  
              - "sort_dir" (``string``): The direction to sort returned items:
                "asc" or "desc".
  
              - "sort_key" (``string``): The field to use for sorting (optional).
  
              - "sort_mode" (``string``): The collating sequence for sorting
                returned items: "auto", "alpha", "alpha_case", or "num".
  
          :type kwargs: ``dict``
  
          **Example**::
  
              import splunklib.client as client
              s = client.connect(...)
              for saved_search in s.saved_searches.iter(pagesize=10):
                  # Loads 10 saved searches at a time from the
                  # server.
                  ...
          """
          assert pagesize is None or pagesize > 0
          if count is None:
              count = self.null_count
          fetched = 0
          while count == self.null_count or fetched < count:
              response = self.get(count=pagesize or count, offset=offset, **kwargs)
              items = self._load_list(response)
              N = len(items)
              fetched += N
              for item in items:
                  yield item
              if pagesize is None or N < pagesize:
                  break
              offset += N
              logging.debug("pagesize=%d, fetched=%d, offset=%d, N=%d, kwargs=%s", pagesize, fetched, offset, N, kwargs)