code: def make_bar_data(asset_info, calendar):
      """
  
      For a given asset/date/column combination, we generate a corresponding raw
      value using the following formula for OHLCV columns:
  
      data(asset, date, column) = (100,000 * asset_id)
                                + (10,000 * column_num)
                                + (date - Jan 1 2000).days  # ~6000 for 2015
      where:
          column_num('open') = 0
          column_num('high') = 1
          column_num('low') = 2
          column_num('close') = 3
          column_num('volume') = 4
  
      We use days since Jan 1, 2000 to guarantee that there are no collisions
      while also the produced values smaller than UINT32_MAX / 1000.
  
      For 'day' and 'id', we use the standard format expected by the base class.
  
      Parameters
      ----------
      asset_info : DataFrame
          DataFrame with asset_id as index and 'start_date'/'end_date' columns.
      calendar : pd.DatetimeIndex
          The trading calendar to use.
  
      Yields
      ------
      p : (int, pd.DataFrame)
          A sid, data pair to be passed to BcolzDailyDailyBarWriter.write
      """
      assert (
          # Using .value here to avoid having to care about UTC-aware dates.
          PSEUDO_EPOCH.value
          < calendar.normalize().min().value
          <= asset_info["start_date"].min().value
      ), "calendar.min(): %s\nasset_info['start_date'].min(): %s" % (
          calendar.min(),
          asset_info["start_date"].min(),
      )
  
      assert (asset_info["start_date"] < asset_info["end_date"]).all()
  
      def _raw_data_for_asset(asset_id):
          """
          Generate 'raw' data that encodes information about the asset.
  
          See docstring for a description of the data format.
          """
          # Get the dates for which this asset existed according to our asset
          # info.
          datetimes = calendar[
              calendar.slice_indexer(
                  asset_start(asset_info, asset_id),
                  asset_end(asset_info, asset_id),
              )
          ]
  
          data = full(
              (len(datetimes), len(US_EQUITY_PRICING_BCOLZ_COLUMNS)),
              asset_id * 100 * 1000,
              dtype=uint32,
          )
  
          # Add 10,000 * column-index to OHLCV columns
          data[:, :5] += arange(5, dtype=uint32) * 1000
  
          # Add days since Jan 1 2001 for OHLCV columns.
          data[:, :5] += (
              (datetimes - PSEUDO_EPOCH).days[:, None].astype(uint32)
          )
  
          frame = DataFrame(
              data,
              index=datetimes,
              columns=US_EQUITY_PRICING_BCOLZ_COLUMNS,
          )
  
          frame["day"] = nanos_to_seconds(datetimes.asi8)
          frame["id"] = asset_id
          return frame
  
      for asset in asset_info.index:
          yield asset, _raw_data_for_asset(asset)
  
imports: from numpy import arange, array, eye, float64, full, iinfo, uint32
  from numpy.random import RandomState
  from pandas import DataFrame, Timestamp
  from six import iteritems
  from sqlite3 import connect
  from .base import PipelineLoader
  from .frame import DataFrameLoader
  from catalyst.data.us_equity_pricing import SQLiteAdjustmentReader, SQLiteAdjustmentWriter, US_EQUITY_PRICING_BCOLZ_COLUMNS
  from catalyst.utils.numpy_utils import bool_dtype, datetime64ns_dtype, float64_dtype, int64_dtype, object_dtype
label_desc: Use image node_id 4 for calling a global function with example usage: make_bar_data(asset_info, calendar) and returns: frame