docstr:         Volume data should look like this:
  
                       CLF17    CLG17    CLH17    CLJ17    CLK17    CLM17   CLN17
         2017-01-03     2000     1000        5        0        0        0       0
         2017-01-04     2000     1000        5        0        0        0       0
             ...
         2017-01-16     2000     1000        5        0        0        0       0
         2017-01-17     2000     1000        5        0        0        0       0
  ACD -> 2017-01-18     2000_    1000        5        0        0        0       0
         2017-01-19     2000 `-> 1000        5        0        0        0       0
         2017-01-20     2000     1000        5        0        0        0       0
         2017-01-23        0     1000        5        0        0        0       0
             ...
         2017-02-09        0     1000        5        0        0        0       0
         2017-02-10        0     1000_    5000        0        0        0       0
         2017-02-13        0     1000 `-> 5000        0        0        0       0
         2017-02-14        0     1000     5000        0        0        0       0
  ACD -> 2017-02-15        0     1000     5000        0        0        0       0
         2017-02-16        0     1000     5000        0        0        0       0
         2017-02-17        0     1000     5000        0        0        0       0
         2017-02-20        0        0     5000        0        0        0       0
             ...
         2017-03-10        0        0     5000        0        0        0       0
         2017-03-13        0        0     5000     4000        0        0       0
         2017-03-14        0        0     5000     4000        0        0       0
  ACD -> 2017-03-15        0        0     5000_    4000     3000        0       0
         2017-03-16        0        0     5000 `-> 4000     3000        0       0
         2017-03-17        0        0     5000     4000     3000        0       0
         2017-03-20        0        0        0     4000     3000        0       0
             ...
         2017-04-14        0        0        0     4000     3000        0       0
         2017-04-17        0        0        0     4000_    3000        0       0
         2017-04-18        0        0        0        0 `-> 3000        0       0
  ACD -> 2017-04-19        0        0        0        0     3000     1000    2000
         2017-04-20        0        0        0        0     3000     1000    2000
         2017-04-21        0        0        0        0     3000     1000    2000
             ...
         2017-05-16        0        0        0        0     3000     1000    2000
         2017-05-17        0        0        0        0     3000     1000    2000
         2017-05-18        0        0        0        0     3000_    1000    2000
  ACD -> 2017-05-19        0        0        0        0     3000 `---1000--> 2000
         2017-05-22        0        0        0        0     3000     1000    2000
         2017-05-23        0        0        0        0     3000     1000    2000
  
          The first roll occurs because we reach the auto close date of CLF17.
          The second roll occurs because the volume of CLH17 overtakes CLG17.
          The third roll is testing the fact that CLJ17 has no data in the grace
          period before CLH17's auto close date.
          The fourth roll is testing that we properly handle the case where a
          contract's auto close date is *after* its end date.
          The fifth roll occurs on the auto close date of CLK17, but we skip over
          CLM17 because of it's low volume, and roll directly to CLN17. This is
          used to cover an edge case where the window passed to get_rolls end on
          the auto close date of CLK17.
  
          A volume of zero here is used to represent the fact that a contract no
          longer exists.
          
code: def make_future_daily_bar_data(cls):
      """
              Volume data should look like this:
  
                           CLF17    CLG17    CLH17    CLJ17    CLK17    CLM17   CLN17
             2017-01-03     2000     1000        5        0        0        0       0
             2017-01-04     2000     1000        5        0        0        0       0
                 ...
             2017-01-16     2000     1000        5        0        0        0       0
             2017-01-17     2000     1000        5        0        0        0       0
      ACD -> 2017-01-18     2000_    1000        5        0        0        0       0
             2017-01-19     2000 `-> 1000        5        0        0        0       0
             2017-01-20     2000     1000        5        0        0        0       0
             2017-01-23        0     1000        5        0        0        0       0
                 ...
             2017-02-09        0     1000        5        0        0        0       0
             2017-02-10        0     1000_    5000        0        0        0       0
             2017-02-13        0     1000 `-> 5000        0        0        0       0
             2017-02-14        0     1000     5000        0        0        0       0
      ACD -> 2017-02-15        0     1000     5000        0        0        0       0
             2017-02-16        0     1000     5000        0        0        0       0
             2017-02-17        0     1000     5000        0        0        0       0
             2017-02-20        0        0     5000        0        0        0       0
                 ...
             2017-03-10        0        0     5000        0        0        0       0
             2017-03-13        0        0     5000     4000        0        0       0
             2017-03-14        0        0     5000     4000        0        0       0
      ACD -> 2017-03-15        0        0     5000_    4000     3000        0       0
             2017-03-16        0        0     5000 `-> 4000     3000        0       0
             2017-03-17        0        0     5000     4000     3000        0       0
             2017-03-20        0        0        0     4000     3000        0       0
                 ...
             2017-04-14        0        0        0     4000     3000        0       0
             2017-04-17        0        0        0     4000_    3000        0       0
             2017-04-18        0        0        0        0 `-> 3000        0       0
      ACD -> 2017-04-19        0        0        0        0     3000     1000    2000
             2017-04-20        0        0        0        0     3000     1000    2000
             2017-04-21        0        0        0        0     3000     1000    2000
                 ...
             2017-05-16        0        0        0        0     3000     1000    2000
             2017-05-17        0        0        0        0     3000     1000    2000
             2017-05-18        0        0        0        0     3000_    1000    2000
      ACD -> 2017-05-19        0        0        0        0     3000 `---1000--> 2000
             2017-05-22        0        0        0        0     3000     1000    2000
             2017-05-23        0        0        0        0     3000     1000    2000
  
              The first roll occurs because we reach the auto close date of CLF17.
              The second roll occurs because the volume of CLH17 overtakes CLG17.
              The third roll is testing the fact that CLJ17 has no data in the grace
              period before CLH17's auto close date.
              The fourth roll is testing that we properly handle the case where a
              contract's auto close date is *after* its end date.
              The fifth roll occurs on the auto close date of CLK17, but we skip over
              CLM17 because of it's low volume, and roll directly to CLN17. This is
              used to cover an edge case where the window passed to get_rolls end on
              the auto close date of CLK17.
  
              A volume of zero here is used to represent the fact that a contract no
              longer exists.
      """
      date_index = cls.trading_calendar.sessions_in_range(
          cls.START_DATE,
          cls.END_DATE,
      )
  
      def create_contract_data(volume):
          # The prices used here are arbitrary as they are irrelevant for the
          # purpose of testing roll behavior.
          return DataFrame(
              {
                  "open": 5,
                  "high": 6,
                  "low": 4,
                  "close": 5,
                  "volume": volume,
              },
              index=date_index,
          )
  
      # Make a copy because we are taking a slice of a data frame.
      first_contract_data = create_contract_data(2000)
      yield 1000, first_contract_data.copy().loc[: cls.first_end_date]
  
      # Make a copy because we are taking a slice of a data frame.
      second_contract_data = create_contract_data(1000)
      yield 1001, second_contract_data.copy().loc[: cls.second_end_date]
  
      third_contract_data = create_contract_data(5)
      volume_flip_date = pd.Timestamp("2017-02-10", tz="UTC")
      third_contract_data.loc[volume_flip_date:, "volume"] = 5000
      yield 1002, third_contract_data
  
      # Make a copy because we are taking a slice of a data frame.
      fourth_contract_data = create_contract_data(4000)
      yield (
          1003,
          fourth_contract_data.copy().loc[
              cls.fourth_start_date : cls.fourth_end_date
          ],
      )
  
      # Make a copy because we are taking a slice of a data frame.
      fifth_contract_data = create_contract_data(3000)
      yield 1004, fifth_contract_data.copy().loc[cls.fifth_start_date :]
  
      sixth_contract_data = create_contract_data(1000)
      yield 1005, sixth_contract_data.copy().loc[cls.last_start_date :]
  
      seventh_contract_data = create_contract_data(2000)
      yield 1006, seventh_contract_data.copy().loc[
          cls.last_start_date :
      ]
  
      # The data for FV does not really matter except that contract 2000 has
      # higher volume than contract 2001.
      yield 2000, create_contract_data(200)
      yield 2001, create_contract_data(100)
  
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 3 for calling the RollFinderTestCase obj's underlying member method code with example usage: obj.make_future_daily_bar_data(cls) and returns: DataFrame