code: def _fetch_metadata_iter(self, api_key, cache, retries, environ):
      for page_number in count(1):
          # Attempt to load metadata page from cache.  If it does not exist,
          # poll the API upto `retries` times in order to get raw DataFrame.
          key = "metadata-page-{pn}.frame".format(pn=page_number)
          try:
              raw = cache[key]
          except KeyError:
              for _ in range(retries):
                  try:
                      raw = self.fetch_raw_metadata_frame(
                          api_key,
                          page_number,
                      )
                      break
                  except ValueError:
                      raw = pd.DataFrame([])
                      break
                  except Exception:
                      log.exception(
                          "Failed to load metadata from {}. "
                          "Retrying.".format(self.name)
                      )
              else:
                  raise ValueError(
                      "Failed to download metadata page {} after {} "
                      "attempts.".format(page_number, retries)
                  )
  
          if raw.empty:
              # Empty DataFrame signals completion.
              break
  
          # Apply selective asset filtering, useful for benchmark
          # ingestion.
          if self._asset_filter:
              raw = raw[raw.symbol.isin(self._asset_filter)]
  
          # Update cached value for key.
          cache[key] = raw
  
          # Return metadata frame to application.
          yield raw
  
imports: from itertools import count
  import tarfile
  from time import sleep
  from abc import abstractmethod, abstractproperty
  import logbook
  import pandas
  from .None import core
  from catalyst.utils.cli import item_show_count, maybe_show_progress
  from catalyst.utils.memoize import lazyval
  from catalyst.constants import LOG_LEVEL
label_desc: Use image node_id 22 for calling the BaseBundle obj's underlying member method code with example usage: obj._fetch_metadata_iter(api_key, cache, retries, environ) without return types