docstr: Test that when a double volume switch occurs we treat the first switch
  as the roll, assuming it is within a certain distance of the next auto
  close date. See `VolumeRollFinder._active_contract` for a full
  explanation and example.
code: def test_double_volume_switch(self):
      """
      Test that when a double volume switch occurs we treat the first switch
      as the roll, assuming it is within a certain distance of the next auto
      close date. See `VolumeRollFinder._active_contract` for a full
      explanation and example.
      """
      cf = self.asset_finder.create_continuous_future(
          "DF",
          0,
          "volume",
          None,
      )
  
      sessions = self.trading_calendar.sessions_in_range(
          "2016-02-09",
          "2016-02-17",
      )
      for session in sessions:
          bar_data = self.create_bardata(lambda: session)
          contract = bar_data.current(cf, "contract")
  
          # The 'G' contract surpasses the 'F' contract in volume on
          # 2016-02-10, which means that the 'G' contract should become the
          # front contract starting on 2016-02-11.
          if session < pd.Timestamp("2016-02-11", tz="UTC"):
              self.assertEqual(contract.symbol, "DFF16")
          else:
              self.assertEqual(contract.symbol, "DFG16")
  
      # This test asserts behavior about a back contract briefly spiking in
      # volume, but more than a week before the front contract's auto close
      # date, meaning it does not fall in the 'grace' period used by
      # `VolumeRollFinder._active_contract`. Therefore we should not roll to
      # the back contract and the front contract should remain current until
      # its auto close date.
      sessions = self.trading_calendar.sessions_in_range(
          "2016-03-01",
          "2016-03-21",
      )
      for session in sessions:
          bar_data = self.create_bardata(lambda: session)
          contract = bar_data.current(cf, "contract")
  
          if session < pd.Timestamp("2016-03-17", tz="UTC"):
              self.assertEqual(contract.symbol, "DFG16")
          else:
              self.assertEqual(contract.symbol, "DFH16")
  
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 4 for calling the ContinuousFuturesTestCase obj's underlying member method code with example usage: obj.test_double_volume_switch() without return types