code: def _test_ingest_candles(self):
      exchange_name = "bitfinex"
      data_frequency = "minute"
  
      exchange = get_exchange(exchange_name)
      bundle = ExchangeBundle(exchange)
      assets = [exchange.get_asset("iot_btc")]
  
      end_dt = pd.to_datetime("2017-10-20", utc=True)
      bar_count = 100
  
      start_dt = get_start_dt(end_dt, bar_count, data_frequency)
      candles = exchange.get_candles(
          assets=assets,
          start_dt=start_dt,
          end_dt=end_dt,
          bar_count=bar_count,
          freq="1T",
      )
  
      writer = bundle.get_writer(start_dt, end_dt, data_frequency)
      for asset in assets:
          dates = [candle["last_traded"] for candle in candles[asset]]
  
          values = dict()
          for field in ["open", "high", "low", "close", "volume"]:
              values[field] = [
                  candle[field] for candle in candles[asset]
              ]
  
          periods = bundle.get_calendar_periods_range(
              start_dt, end_dt, data_frequency
          )
          df = pd.DataFrame(values, index=dates)
          df = df.loc[periods].fillna(method="ffill")
  
          # TODO: why do I get an extra bar?
          bundle.ingest_df(
              ohlcv_df=df,
              data_frequency=data_frequency,
              asset=asset,
              writer=writer,
              empty_rows_behavior="raise",
              duplicates_behavior="raise",
          )
  
      bundle_series = bundle.get_history_window_series(
          assets=assets,
          end_dt=end_dt,
          bar_count=bar_count,
          field="close",
          data_frequency=data_frequency,
          reset_reader=True,
      )
      df = pd.DataFrame(bundle_series)
      print("\n" + df_to_string(df))
      pass
  
imports: import os
  import tempfile
  from logging import getLogger
  import pandas
  from catalyst.exchange.exchange_bcolz import BcolzExchangeBarReader, BcolzExchangeBarWriter
  from catalyst.exchange.exchange_bundle import ExchangeBundle, BUNDLE_NAME_TEMPLATE
  from catalyst.exchange.utils.bundle_utils import get_bcolz_chunk, get_df_from_arrays
  from catalyst.exchange.utils.datetime_utils import get_start_dt
  from catalyst.exchange.utils.exchange_utils import get_exchange_folder
  from catalyst.exchange.utils.factory import get_exchange
  from catalyst.exchange.utils.stats_utils import df_to_string
  from catalyst.utils.paths import ensure_directory
label_desc: Use image node_id 11 for calling the TestExchangeBundle obj's underlying member method code with example usage: obj._test_ingest_candles() without return types