code: def test_daily_splits_and_mergers(self):
      # self.SPLIT_ASSET and self.MERGER_ASSET had splits/mergers
      # on 1/6 and 1/7.  they both started trading on 1/5
  
      for asset in [self.SPLIT_ASSET, self.MERGER_ASSET]:
          # before any of the adjustments
          window1 = self.data_portal.get_history_window(
              [asset],
              pd.Timestamp("2015-01-05", tz="UTC"),
              1,
              "1d",
              "close",
              "daily",
          )[asset]
  
          np.testing.assert_array_equal(window1, [2])
  
          window1_volume = self.data_portal.get_history_window(
              [asset],
              pd.Timestamp("2015-01-05", tz="UTC"),
              1,
              "1d",
              "volume",
              "daily",
          )[asset]
  
          np.testing.assert_array_equal(window1_volume, [200])
  
          # straddling the first event
          window2 = self.data_portal.get_history_window(
              [asset],
              pd.Timestamp("2015-01-06", tz="UTC"),
              2,
              "1d",
              "close",
              "daily",
          )[asset]
  
          # first value should be halved, second value unadjusted
          np.testing.assert_array_equal([0.5, 3], window2)
  
          window2_volume = self.data_portal.get_history_window(
              [asset],
              pd.Timestamp("2015-01-06", tz="UTC"),
              2,
              "1d",
              "volume",
              "daily",
          )[asset]
  
          if asset == self.SPLIT_ASSET:
              # first value should be doubled, second value unadjusted
              np.testing.assert_array_equal(window2_volume, [800, 300])
          elif asset == self.MERGER_ASSET:
              np.testing.assert_array_equal(window2_volume, [200, 300])
  
          # straddling both events
          window3 = self.data_portal.get_history_window(
              [asset],
              pd.Timestamp("2015-01-07", tz="UTC"),
              3,
              "1d",
              "close",
              "daily",
          )[asset]
  
          np.testing.assert_array_equal([0.25, 1.5, 4], window3)
  
          window3_volume = self.data_portal.get_history_window(
              [asset],
              pd.Timestamp("2015-01-07", tz="UTC"),
              3,
              "1d",
              "volume",
              "daily",
          )[asset]
  
          if asset == self.SPLIT_ASSET:
              np.testing.assert_array_equal(
                  window3_volume, [1600, 600, 400]
              )
          elif asset == self.MERGER_ASSET:
              np.testing.assert_array_equal(
                  window3_volume, [200, 300, 400]
              )
  
imports: from textwrap import dedent
  from nose_parameterized import parameterized
  import numpy
  from numpy import nan
  import pandas
  from six import iteritems
  from catalyst import TradingAlgorithm
  from catalyst._protocol import handle_non_market_minutes, BarData
  from catalyst.assets import Asset, Equity
  from catalyst.errors import HistoryInInitialize, HistoryWindowStartsBeforeData
  from catalyst.finance.trading import SimulationParameters
  from catalyst.finance.asset_restrictions import NoRestrictions
  from catalyst.testing import create_minute_df_for_asset, str_to_seconds, MockDailyBarReader
  from catalyst.testing.fixtures import WithCreateBarData, WithDataPortal, CatalystTestCase, alias
label_desc: Use image node_id 7 for calling the DailyEquityHistoryTestCase obj's underlying member method code with example usage: obj.test_daily_splits_and_mergers() without return types