code: def iter(self, offset=0, count=None, pagesize=None, **kwargs):
          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)