docstr: Creates DataFrames from the bundle and exchange for the specified
  data set.
  
  Parameters
  ----------
  exchange: Exchange
  assets
  end_dt
  bar_count
  freq
  data_frequency
  data_portal
  
  Returns
  -------
docstr_tok: ["Creates","DataFrames","from","the","bundle","and","exchange","for","the","specified","data","set",".","Parameters","--","--","--","--","--","exchange",":","Exchange","assets","end_dt","bar_count","freq","data_frequency","data_portal","Returns","--","--","--","-"]
code: def compare_bundle_with_exchange(
      self,
      exchange,
      assets,
      end_dt,
      bar_count,
      freq,
      data_frequency,
      data_portal,
      field,
  ):
      """
      Creates DataFrames from the bundle and exchange for the specified
      data set.
  
      Parameters
      ----------
      exchange: Exchange
      assets
      end_dt
      bar_count
      freq
      data_frequency
      data_portal
  
      Returns
      -------
  
      """
      data = dict()
  
      log_catcher = TestHandler()
      with log_catcher:
          symbols = [asset.symbol for asset in assets]
          print(
              "comparing {} for {}/{} with {} timeframe until {}".format(
                  field, exchange.name, symbols, freq, end_dt
              )
          )
          data["bundle"] = data_portal.get_history_window(
              assets=assets,
              end_dt=end_dt,
              bar_count=bar_count,
              frequency=freq,
              field=field,
              data_frequency=data_frequency,
          )
          set_print_settings()
          print("the bundle data:\n{}".format(data["bundle"]))
          candles = exchange.get_candles(
              end_dt=end_dt,
              freq=freq,
              assets=assets,
              bar_count=bar_count,
          )
          data["exchange"] = get_candles_df(
              candles=candles,
              field=field,
              freq=freq,
              bar_count=bar_count,
              end_dt=end_dt,
          )
          print("the exchange data:\n{}".format(data["exchange"]))
          for source in data:
              df = data[source]
              path, folder = output_df(
                  df, assets, "{}_{}".format(freq, source)
              )
  
          print("saved {} test results: {}".format(end_dt, folder))
  
          assert_frame_equal(
              right=data["bundle"][:-1],
              left=data["exchange"][:-1],
              check_less_precise=1,
          )
          try:
              assert_frame_equal(
                  right=data["bundle"][:-1],
                  left=data["exchange"][:-1],
                  check_less_precise=min([a.decimals for a in assets]),
              )
          except Exception as e:
              print(
                  "Some differences were found within a 1 decimal point "
                  "interval of confidence: {}".format(e)
              )
              with open(
                  os.path.join(folder, "compare.txt"), "w+"
              ) as handle:
                  handle.write(e.args[0])
  
          pass
  
file_path: catalyst/tests/exchange/test_suites/test_suite_bundle.py
imports: import random
  import os
  import pandas
  from datetime import timedelta
  from logbook import TestHandler
  from pandas.util.testing import assert_frame_equal
  from catalyst import get_calendar
  from catalyst.exchange.exchange_asset_finder import ExchangeAssetFinder
  from catalyst.exchange.exchange_data_portal import DataPortalExchangeBacktest
  from catalyst.exchange.utils.exchange_utils import get_candles_df
  from catalyst.exchange.utils.factory import get_exchange
  from catalyst.exchange.utils.test_utils import output_df, select_random_assets
  from catalyst.exchange.utils.stats_utils import set_print_settings
label_desc: Use image node_id 2 for calling the TestSuiteBundle obj's underlying member method code with example usage: obj.compare_bundle_with_exchange(exchange, assets, end_dt, bar_count, freq, data_frequency, data_portal, field) without return types