code: def compute_expected_vwaps(self, window_lengths):
      AAPL, MSFT, BRK_A = self.AAPL, self.MSFT, self.BRK_A
      # Our view of the data before AAPL's split on June 9, 2014.
      raw = {k: v.copy() for k, v in iteritems(self.raw_data)}
  
      split_date = self.AAPL_split_date
      split_loc = self.dates.get_loc(split_date)
      split_ratio = 7.0
  
      # Our view of the data after AAPL's split.  All prices from before June
      # 9 get divided by the split ratio, and volumes get multiplied by the
      # split ratio.
      adj = {k: v.copy() for k, v in iteritems(self.raw_data)}
      for column in "open", "high", "low", "close":
          adj[AAPL].ix[:split_loc, column] /= split_ratio
      adj[AAPL].ix[:split_loc, "volume"] *= split_ratio
  
      # length -> asset -> expected vwap
      vwaps = {length: {} for length in window_lengths}
      for length in window_lengths:
          for asset in AAPL, MSFT, BRK_A:
              raw_vwap = rolling_vwap(raw[asset], length)
              adj_vwap = rolling_vwap(adj[asset], length)
              # Shift computed results one day forward so that they're
              # labelled by the date on which they'll be seen in the
              # algorithm. (We can't show the close price for day N until day
              # N + 1.)
              vwaps[length][asset] = concat(
                  [raw_vwap[: split_loc - 1], adj_vwap[split_loc - 1 :]]
              ).shift(1, self.trading_calendar.day)
  
      # Make sure all the expected vwaps have the same dates.
      vwap_dates = vwaps[1][self.AAPL].index
      for dict_ in itervalues(vwaps):
          # Each value is a dict mapping sid -> expected series.
          for series in itervalues(dict_):
              self.assertTrue((vwap_dates == series.index).all())
  
      # Spot check expectations near the AAPL split.
      # length 1 vwap for the morning before the split should be the close
      # price of the previous day.
      before_split = vwaps[1][AAPL].loc[
          split_date - self.trading_calendar.day
      ]
      assert_almost_equal(before_split, 647.3499, decimal=2)
      assert_almost_equal(
          before_split,
          raw[AAPL].loc[
              split_date - (2 * self.trading_calendar.day), "close"
          ],
          decimal=2,
      )
  
      # length 1 vwap for the morning of the split should be the close price
      # of the previous day, **ADJUSTED FOR THE SPLIT**.
      on_split = vwaps[1][AAPL].loc[split_date]
      assert_almost_equal(on_split, 645.5700 / split_ratio, decimal=2)
      assert_almost_equal(
          on_split,
          raw[AAPL].loc[split_date - self.trading_calendar.day, "close"]
          / split_ratio,
          decimal=2,
      )
  
      # length 1 vwap on the day after the split should be the as-traded
      # close on the split day.
      after_split = vwaps[1][AAPL].loc[
          split_date + self.trading_calendar.day
      ]
      assert_almost_equal(after_split, 93.69999, decimal=2)
      assert_almost_equal(
          after_split,
          raw[AAPL].loc[split_date, "close"],
          decimal=2,
      )
  
      return vwaps
  
imports: from os.path import dirname, join, realpath
  from nose_parameterized import parameterized
  import numpy
  from numpy import array, arange, full_like, float64, nan, uint32
  from numpy.testing import assert_almost_equal
  import pandas
  from pandas import concat, DataFrame, date_range, read_csv, Series, Timestamp
  from six import iteritems, itervalues
  from trading_calendars import get_calendar
  from zipline.api import attach_pipeline, pipeline_output, get_datetime
  from zipline.errors import AttachPipelineAfterInitialize, PipelineOutputDuringInitialize, NoSuchPipeline, DuplicatePipelineName
  from zipline.finance.trading import SimulationParameters
  from zipline.lib.adjustment import MULTIPLY
  from zipline.pipeline import Pipeline, CustomFactor
  from zipline.pipeline.factors import VWAP
  from zipline.pipeline.data import USEquityPricing
  from zipline.pipeline.loaders.frame import DataFrameLoader
  from zipline.pipeline.loaders.equity_pricing_loader import USEquityPricingLoader
  from zipline.testing import str_to_seconds
  from zipline.testing import create_empty_splits_mergers_frame
  from zipline.testing.fixtures import WithMakeAlgo, WithAdjustmentReader, WithBcolzEquityDailyBarReaderFromCSVs, ZiplineTestCase
  from zipline.utils.pandas_utils import normalize_date
label_desc: Use image node_id 7 for calling the PipelineAlgorithmTestCase obj's underlying member method code with example usage: obj.compute_expected_vwaps(window_lengths) and returns: vwaps