code: def test_before_trading_start_runs_at_8_45(
      self, num_sessions, data_frequency, emission_rate
  ):
      bts_times = []
  
      def initialize(algo, data):
          pass
  
      def before_trading_start(algo, data):
          bts_times.append(algo.get_datetime())
  
      sim_params = SimulationParameters(
          # start at index 1 so we have an extra day to calculate benchmark
          # returns.
          start_session=self.nyse_sessions[1],
          end_session=self.nyse_sessions[num_sessions],
          data_frequency=data_frequency,
          emission_rate=emission_rate,
          trading_calendar=self.trading_calendar,
      )
  
      self.run_algorithm(
          before_trading_start=before_trading_start,
          sim_params=sim_params,
      )
  
      self.assertEqual(len(bts_times), num_sessions)
      expected_times = [
          pd.Timestamp("2016-03-11 8:45", tz="US/Eastern").tz_convert(
              "UTC"
          ),
          pd.Timestamp("2016-03-14 8:45", tz="US/Eastern").tz_convert(
              "UTC"
          ),
          pd.Timestamp("2016-03-15 8:45", tz="US/Eastern").tz_convert(
              "UTC"
          ),
      ]
      self.assertEqual(bts_times, expected_times[:num_sessions])
  
imports: import pandas
  from zipline.gens.sim_engine import BEFORE_TRADING_START_BAR
  from zipline.finance.asset_restrictions import NoRestrictions
  from zipline.finance import metrics
  from zipline.finance.trading import SimulationParameters
  from zipline.gens.tradesimulation import AlgorithmSimulator
  from zipline.testing.core import parameter_space
  import zipline.testing.fixtures
label_desc: Use image node_id 1 for calling the TestBeforeTradingStartTiming obj's underlying member method code with example usage: obj.test_before_trading_start_runs_at_8_45(num_sessions, data_frequency, emission_rate) without return types