code: def test_history_close_session_adjusted(self):
      cf = self.data_portal.asset_finder.create_continuous_future(
          "FO", 0, "calendar", None
      )
      cf_mul = self.data_portal.asset_finder.create_continuous_future(
          "FO", 0, "calendar", "mul"
      )
      cf_add = self.data_portal.asset_finder.create_continuous_future(
          "FO", 0, "calendar", "add"
      )
      window = self.data_portal.get_history_window(
          [cf, cf_mul, cf_add],
          Timestamp("2016-03-06", tz="UTC"),
          30,
          "1d",
          "close",
          "daily",
      )
  
      # Unadjusted value is: 115011.44
      # Adjustment is based on hop from 115231.44 to 125231.44
      # a ratio of ~0.920
      assert_almost_equal(
          window.loc["2016-01-26", cf_mul],
          124992.348,
          err_msg="At beginning of window, should be FOG16's first value, "
          "adjusted.",
      )
  
      # Difference of 7008.561
      assert_almost_equal(
          window.loc["2016-01-26", cf_add],
          125011.44,
          err_msg="At beginning of window, should be FOG16's first value, "
          "adjusted.",
      )
  
      assert_almost_equal(
          window.loc["2016-02-26", cf_mul],
          125241.440,
          err_msg="On session with roll, should be FOH16's 24th value, "
          "unadjusted.",
      )
  
      assert_almost_equal(
          window.loc["2016-02-26", cf_add],
          125241.440,
          err_msg="On session with roll, should be FOH16's 24th value, "
          "unadjusted.",
      )
  
      assert_almost_equal(
          window.loc["2016-02-29", cf_mul],
          125251.440,
          err_msg="After roll, Should be FOH16's 25th value, unadjusted.",
      )
  
      assert_almost_equal(
          window.loc["2016-02-29", cf_add],
          125251.440,
          err_msg="After roll, Should be FOH16's 25th value, unadjusted.",
      )
  
      # Advance the window a month.
      window = self.data_portal.get_history_window(
          [cf, cf_mul, cf_add],
          Timestamp("2016-04-06", tz="UTC"),
          30,
          "1d",
          "close",
          "daily",
      )
  
      # Unadjusted value: 115221.44
      # Adjustments based on hops:
      # 2016-02-25 00:00:00+00:00
      # front 115231.440
      # back  125231.440
      # ratio: ~0.920
      # difference: 10000.0
      # and
      # 2016-03-23 00:00:00+00:00
      # front 125421.440
      # back  135421.440
      # ratio: ~1.080
      # difference: 10000.00
      assert_almost_equal(
          window.loc["2016-02-24", cf_mul],
          135236.905,
          err_msg="At beginning of window, should be FOG16's 22nd value, "
          "with two adjustments.",
      )
  
      assert_almost_equal(
          window.loc["2016-02-24", cf_add],
          135251.44,
          err_msg="At beginning of window, should be FOG16's 22nd value, "
          "with two adjustments",
      )
  
      # Unadjusted: 125241.44
      assert_almost_equal(
          window.loc["2016-02-26", cf_mul],
          135259.442,
          err_msg="On session with roll, should be FOH16's 24th value, "
          "with one adjustment.",
      )
  
      assert_almost_equal(
          window.loc["2016-02-26", cf_add],
          135271.44,
          err_msg="On session with roll, should be FOH16's 24th value, "
          "with one adjustment.",
      )
  
      # Unadjusted: 125251.44
      assert_almost_equal(
          window.loc["2016-02-29", cf_mul],
          135270.241,
          err_msg="On session after roll, should be FOH16's 25th value, "
          "with one adjustment.",
      )
  
      assert_almost_equal(
          window.loc["2016-02-29", cf_add],
          135281.44,
          err_msg="On session after roll, should be FOH16's 25th value, "
          "unadjusted.",
      )
  
      # Unadjusted: 135431.44
      assert_almost_equal(
          window.loc["2016-03-24", cf_mul],
          135431.44,
          err_msg="On session with roll, should be FOJ16's 43rd value, "
          "unadjusted.",
      )
  
      assert_almost_equal(
          window.loc["2016-03-24", cf_add],
          135431.44,
          err_msg="On session with roll, should be FOJ16's 43rd value.",
      )
  
      # Unadjusted: 135441.44
      assert_almost_equal(
          window.loc["2016-03-28", cf_mul],
          135441.44,
          err_msg="On session after roll, Should be FOJ16's 44th value.",
      )
  
      assert_almost_equal(
          window.loc["2016-03-28", cf_add],
          135441.44,
          err_msg="On session after roll, Should be FOJ16's 44th value.",
      )
  
imports: from collections import deque
  from functools import partial
  from textwrap import dedent
  from numpy import arange, array, int64, full, repeat, tile
  from numpy.testing import assert_almost_equal
  import pandas
  from pandas import Timestamp, DataFrame
  from zipline.assets.continuous_futures import OrderedContracts, delivery_predicate
  from zipline.assets.roll_finder import ROLL_DAYS_FOR_CURRENT_CONTRACT, VolumeRollFinder
  from zipline.data.minute_bars import FUTURES_MINUTES_PER_DAY
  from zipline.errors import SymbolNotFound
  import zipline.testing.fixtures
label_desc: Use image node_id 19 for calling the ContinuousFuturesTestCase obj's underlying member method code with example usage: obj.test_history_close_session_adjusted() without return types