code: def _get_window_data(self, data, asset, window_length):
          
          try:
              values = self._window_data_cache.get(asset, data.current_session)
          except KeyError:
              try:
                  # Add a day because we want 'window_length' complete days,
                  # excluding the current day.
                  volume_history = data.history(
                      asset, 'volume', window_length + 1, '1d',
                  )
                  close_history = data.history(
                      asset, 'close', window_length + 1, '1d',
                  )
              except HistoryWindowStartsBeforeData:
                  # If there is not enough data to do a full history call, return
                  # values as if there was no data.
                  return 0, np.NaN
  
              # Exclude the first value of the percent change array because it is
              # always just NaN.
              close_volatility = close_history[:-1].pct_change()[1:].std(
                  skipna=False,
              )
              values = {
                  'volume': volume_history[:-1].mean(),
                  'close': close_volatility * SQRT_252,
              }
              self._window_data_cache.set(asset, values, data.current_session)
  
          return values['volume'], values['close']
docs: Internal utility method to return the trailing mean volume over the
          past 'window_length' days, and volatility of close prices for a
          specific asset.
  
          Parameters
          ----------
          data : The BarData from which to fetch the daily windows.
          asset : The Asset whose data we are fetching.
          window_length : Number of days of history used to calculate the mean
              volume and close price volatility.
  
          Returns
          -------
          (mean volume, volatility)