code: def _pricing_iter(
      csvdir, symbols, metadata, divs_splits, show_progress
  ):
      with maybe_show_progress(
          symbols, show_progress, label="Loading custom pricing data: "
      ) as it:
          files = os.listdir(csvdir)
          for sid, symbol in enumerate(it):
              logger.debug("%s: sid %s" % (symbol, sid))
  
              try:
                  fname = [
                      fname
                      for fname in files
                      if "%s.csv" % symbol in fname
                  ][0]
              except IndexError:
                  raise ValueError(
                      "%s.csv file is not in %s" % (symbol, csvdir)
                  )
  
              dfr = read_csv(
                  os.path.join(csvdir, fname),
                  parse_dates=[0],
                  infer_datetime_format=True,
                  index_col=0,
              ).sort_index()
  
              start_date = dfr.index[0]
              end_date = dfr.index[-1]
  
              # The auto_close date is the day after the last trade.
              ac_date = end_date + Timedelta(days=1)
              metadata.iloc[sid] = start_date, end_date, ac_date, symbol
  
              if "split" in dfr.columns:
                  tmp = 1.0 / dfr[dfr["split"] != 1.0]["split"]
                  split = DataFrame(
                      data=tmp.index.tolist(),
                      columns=["effective_date"],
                  )
                  split["ratio"] = tmp.tolist()
                  split["sid"] = sid
  
                  splits = divs_splits["splits"]
                  index = Index(
                      range(
                          splits.shape[0],
                          splits.shape[0] + split.shape[0],
                      )
                  )
                  split.set_index(index, inplace=True)
                  divs_splits["splits"] = splits.append(split)
  
              if "dividend" in dfr.columns:
                  # ex_date   amount  sid record_date declared_date pay_date
                  tmp = dfr[dfr["dividend"] != 0.0]["dividend"]
                  div = DataFrame(
                      data=tmp.index.tolist(), columns=["ex_date"]
                  )
                  div["record_date"] = NaT
                  div["declared_date"] = NaT
                  div["pay_date"] = NaT
                  div["amount"] = tmp.tolist()
                  div["sid"] = sid
  
                  divs = divs_splits["divs"]
                  ind = Index(
                      range(divs.shape[0], divs.shape[0] + div.shape[0])
                  )
                  div.set_index(ind, inplace=True)
                  divs_splits["divs"] = divs.append(div)
  
              yield sid, dfr
  
file_path: zipline/zipline/data/bundles/csvdir.py
imports: import os
  import sys
  from logbook import Logger, StreamHandler
  from numpy import empty
  from pandas import DataFrame, read_csv, Index, Timedelta, NaT
  from trading_calendars import register_calendar_alias
  from zipline.utils.cli import maybe_show_progress
  from .None import core
label_desc: Use image node_id 3 for calling a global function with example usage: _pricing_iter(csvdir, symbols, metadata, divs_splits, show_progress) without return types