class_docstr: Loader for sliding history windows, with support for adjustments.
  
  Parameters
  ----------
  trading_calendar: TradingCalendar
      Contains the grouping logic needed to assign minutes to periods.
  reader : DailyBarReader, MinuteBarReader
      Reader for pricing bars.
  adjustment_reader : SQLiteAdjustmentReader
      Reader for adjustment data.
class_docstr_tok: ["Loader","for","sliding","history","windows",",","with","support","for","adjustments",".","Parameters","--","--","--","--","--","trading_calendar",":","TradingCalendar","Contains","the","grouping","logic","needed","to","assign","minutes","to","periods",".","reader",":","DailyBarReader",",","MinuteBarReader","Reader","for","pricing","bars",".","adjustment_reader",":","SQLiteAdjustmentReader","Reader","for","adjustment","data","."]
docstr: A window of pricing data with adjustments applied assuming that the
  end of the window is the day before the current simulation time.
  
  Parameters
  ----------
  assets : iterable of Assets
      The assets in the window.
  dts : iterable of datetime64-like
      The datetimes for which to fetch data.
      Makes an assumption that all dts are present and contiguous,
      in the calendar.
  field : str
      The OHLCV field for which to retrieve data.
  is_perspective_after : bool
      True, if the window is being viewed immediately after the last dt
      in the sliding window.
      False, if the window is viewed on the last dt.
  
      This flag is used for handling the case where the last dt in the
      requested window immediately precedes a corporate action, e.g.:
  
      - is_perspective_after is True
  
      When the viewpoint is after the last dt in the window, as when a
      daily history window is accessed from a simulation that uses a
      minute data frequency, the history call to this loader will not
      include the current simulation dt. At that point in time, the raw
      data for the last day in the window will require adjustment, so the
      most recent adjustment with respect to the simulation time is
      applied to the last dt in the requested window.
  
      An example equity which has a 0.5 split ratio dated for 05-27,
      with the dts for a history call of 5 bars with a '1d' frequency at
      05-27 9:31. Simulation frequency is 'minute'.
  
      (In this case this function is called with 4 daily dts, and the
       calling function is responsible for stitching back on the
       'current' dt)
  
      |       |       |       |       | last dt | <-- viewer is here |
      |       | 05-23 | 05-24 | 05-25 | 05-26   | 05-27 9:31         |
      | raw   | 10.10 | 10.20 | 10.30 | 10.40   |                    |
      | adj   |  5.05 |  5.10 |  5.15 |  5.25   |                    |
  
      The adjustment is applied to the last dt, 05-26, and all previous
      dts.
  
      - is_perspective_after is False, daily
  
      When the viewpoint is the same point in time as the last dt in the
      window, as when a daily history window is accessed from a
      simulation that uses a daily data frequency, the history call will
      include the current dt. At that point in time, the raw data for the
      last day in the window will be post-adjustment, so no adjustment
      is applied to the last dt.
  
      An example equity which has a 0.5 split ratio dated for 05-27,
      with the dts for a history call of 5 bars with a '1d' frequency at
      05-27 0:00. Simulation frequency is 'daily'.
  
      |       |       |       |       |       | <-- viewer is here |
      |       |       |       |       |       | last dt            |
      |       | 05-23 | 05-24 | 05-25 | 05-26 | 05-27              |
      | raw   | 10.10 | 10.20 | 10.30 | 10.40 | 5.25               |
      | adj   |  5.05 |  5.10 |  5.15 |  5.20 | 5.25               |
  
      Adjustments are applied 05-23 through 05-26 but not to the last dt,
      05-27
  
  Returns
  -------
  out : np.ndarray with shape(len(days between start, end), len(assets))
docstr_tok: ["A","window","of","pricing","data","with","adjustments","applied","assuming","that","the","end","of","the","window","is","the","day","before","the","current","simulation","time",".","Parameters","--","--","--","--","--","assets",":","iterable","of","Assets","The","assets","in","the","window",".","dts",":","iterable","of","datetime64-like","The","datetimes","for","which","to","fetch","data",".","Makes","an","assumption","that","all","dts","are","present","and","contiguous",",","in","the","calendar",".","field",":","str","The","OHLCV","field","for","which","to","retrieve","data",".","is_perspective_after",":","bool","True",",","if","the","window","is","being","viewed","immediately","after","the","last","dt","in","the","sliding","window",".","False",",","if","the","window","is","viewed","on","the","last","dt",".","This","flag","is","used","for","handling","the","case","where","the","last","dt","in","the","requested","window","immediately","precedes","a","corporate","action",",","e.g",".",":","-","is_perspective_after","is","True","When","the","viewpoint","is","after","the","last","dt","in","the","window",",","as","when","a","daily","history","window","is","accessed","from","a","simulation","that","uses","a","minute","data","frequency",",","the","history","call","to","this","loader","will","not","include","the","current","simulation","dt",".","At","that","point","in","time",",","the","raw","data","for","the","last","day","in","the","window","will","require","adjustment",",","so","the","most","recent","adjustment","with","respect","to","the","simulation","time","is","applied","to","the","last","dt","in","the","requested","window",".","An","example","equity","which","has","a","0.5","split","ratio","dated","for","05-27",",","with","the","dts","for","a","history","call","of","5","bars","with","a","'1d","'","frequency","at","05-27","9:31",".","Simulation","frequency","is","'minute","'",".","(","In","this","case","this","function","is","called","with","4","daily","dts",",","and","the","calling","function","is","responsible","for","stitching","back","on","the","'current","'","dt",")","|","|","|","|","|","last","dt","|","<","--","viewer","is","here","|","|","|","05-23","|","05-24","|","05-25","|","05-26","|","05-27","9:31","|","|","raw","|","10.10","|","10.20","|","10.30","|","10.40","|","|","|","adj","|","5.05","|","5.10","|","5.15","|","5.25","|","|","The","adjustment","is","applied","to","the","last","dt",",","05-26",",","and","all","previous","dts",".","-","is_perspective_after","is","False",",","daily","When","the","viewpoint","is","the","same","point","in","time","as","the","last","dt","in","the","window",",","as","when","a","daily","history","window","is","accessed","from","a","simulation","that","uses","a","daily","data","frequency",",","the","history","call","will","include","the","current","dt",".","At","that","point","in","time",",","the","raw","data","for","the","last","day","in","the","window","will","be","post-adjustment",",","so","no","adjustment","is","applied","to","the","last","dt",".","An","example","equity","which","has","a","0.5","split","ratio","dated","for","05-27",",","with","the","dts","for","a","history","call","of","5","bars","with","a","'1d","'","frequency","at","05-27","0:00",".","Simulation","frequency","is","'daily","'",".","|","|","|","|","|","|","<","--","viewer","is","here","|","|","|","|","|","|","|","last","dt","|","|","|","05-23","|","05-24","|","05-25","|","05-26","|","05-27","|","|","raw","|","10.10","|","10.20","|","10.30","|","10.40","|","5.25","|","|","adj","|","5.05","|","5.10","|","5.15","|","5.20","|","5.25","|","Adjustments","are","applied","05-23","through","05-26","but","not","to","the","last","dt",",","05-27","Returns","--","--","--","-","out",":","np.ndarray","with","shape","(","len","(","days","between","start",",","end",")",",","len","(","assets",")",")"]
code: def history(self, assets, dts, field, is_perspective_after):
      """
      A window of pricing data with adjustments applied assuming that the
      end of the window is the day before the current simulation time.
  
      Parameters
      ----------
      assets : iterable of Assets
          The assets in the window.
      dts : iterable of datetime64-like
          The datetimes for which to fetch data.
          Makes an assumption that all dts are present and contiguous,
          in the calendar.
      field : str
          The OHLCV field for which to retrieve data.
      is_perspective_after : bool
          True, if the window is being viewed immediately after the last dt
          in the sliding window.
          False, if the window is viewed on the last dt.
  
          This flag is used for handling the case where the last dt in the
          requested window immediately precedes a corporate action, e.g.:
  
          - is_perspective_after is True
  
          When the viewpoint is after the last dt in the window, as when a
          daily history window is accessed from a simulation that uses a
          minute data frequency, the history call to this loader will not
          include the current simulation dt. At that point in time, the raw
          data for the last day in the window will require adjustment, so the
          most recent adjustment with respect to the simulation time is
          applied to the last dt in the requested window.
  
          An example equity which has a 0.5 split ratio dated for 05-27,
          with the dts for a history call of 5 bars with a '1d' frequency at
          05-27 9:31. Simulation frequency is 'minute'.
  
          (In this case this function is called with 4 daily dts, and the
           calling function is responsible for stitching back on the
           'current' dt)
  
          |       |       |       |       | last dt | <-- viewer is here |
          |       | 05-23 | 05-24 | 05-25 | 05-26   | 05-27 9:31         |
          | raw   | 10.10 | 10.20 | 10.30 | 10.40   |                    |
          | adj   |  5.05 |  5.10 |  5.15 |  5.25   |                    |
  
          The adjustment is applied to the last dt, 05-26, and all previous
          dts.
  
          - is_perspective_after is False, daily
  
          When the viewpoint is the same point in time as the last dt in the
          window, as when a daily history window is accessed from a
          simulation that uses a daily data frequency, the history call will
          include the current dt. At that point in time, the raw data for the
          last day in the window will be post-adjustment, so no adjustment
          is applied to the last dt.
  
          An example equity which has a 0.5 split ratio dated for 05-27,
          with the dts for a history call of 5 bars with a '1d' frequency at
          05-27 0:00. Simulation frequency is 'daily'.
  
          |       |       |       |       |       | <-- viewer is here |
          |       |       |       |       |       | last dt            |
          |       | 05-23 | 05-24 | 05-25 | 05-26 | 05-27              |
          | raw   | 10.10 | 10.20 | 10.30 | 10.40 | 5.25               |
          | adj   |  5.05 |  5.10 |  5.15 |  5.20 | 5.25               |
  
          Adjustments are applied 05-23 through 05-26 but not to the last dt,
          05-27
  
      Returns
      -------
      out : np.ndarray with shape(len(days between start, end), len(assets))
      """
      block = self._ensure_sliding_windows(
          assets, dts, field, is_perspective_after
      )
      end_ix = self._calendar.searchsorted(dts[-1])
  
      return concatenate(
          [window.get(end_ix) for window in block],
          axis=1,
      )
  
imports: from abc import ABCMeta, abstractmethod, abstractproperty
  from numpy import concatenate
  from lru import LRU
  from pandas import isnull
  from toolz import sliding_window
  from six import with_metaclass
  from zipline.assets import Equity, Future
  from zipline.assets.continuous_futures import ContinuousFuture
  from zipline.lib._int64window import AdjustedArrayWindow
  from zipline.lib._float64window import AdjustedArrayWindow
  from zipline.lib.adjustment import Float64Multiply, Float64Add
  from zipline.utils.cache import ExpiringCache
  from zipline.utils.math_utils import number_of_decimal_places
  from zipline.utils.memoize import lazyval
  from zipline.utils.numpy_utils import float64_dtype
  from zipline.utils.pandas_utils import find_in_sorted_index, normalize_date
label_desc: Use image node_id 7 for calling the HistoryLoader obj's underlying member method code with example usage: obj.history(assets, dts, field, is_perspective_after) and returns: concatenate