code: def _iterator(self, response):
          '''
          Iterate through view data.
          '''
  
          while True:
              result = deque(self._parse_data(response))
              del response
              if result:
                  doc_count = len(result)
                  last = result.pop()
                  while result:
                      yield result.popleft()
  
                  # We expect doc_count = self._page_size + 1 results, if
                  # we have self._page_size or less it means we are on the
                  # last page and need to return the last result.
                  if doc_count < self._real_page_size:
                      yield last
                      break
                  del result
  
                  # if we are in a view, keys could be duplicate so we
                  # need to start from the right docid
                  if last['id']:
                      response = self._call(startkey=last['key'],
                                            startkey_docid=last['id'])
                  # reduce result keys are unique by definition
                  else:
                      response = self._call(startkey=last['key'])
  
              else:
                  breaf _iterator(self, response):
          '''
          Iterate through view data.
          '''
  
          while True:
              result = deque(self._parse_data(response))
              del response
              if result:
                  doc_count = len(result)
                  last = result.pop()
                  while result:
                      yield result.popleft()
  
                  # We expect doc_count = self._page_size + 1 results, if
                  # we have self._page_size or less it means we are on the
                  # last page and need to return the last result.
                  if doc_count < self._real_page_size:
                      yield last
                      break
                  del result
  
                  # if we are in a view, keys could be duplicate so we
                  # need to start from the right docid
                  if last['id']:
                      response = self._call(startkey=last['key'],
                                            startkey_docid=last['id'])
                  # reduce result keys are unique by definition
                  else:
                      response = self._call(startkey=last['key'])
  
              else:
                  break
docs: Iterate through view data.