code: def _rolling_window(a, window):
      """
      [True, True, False, True, False], 2 ->
  
      [
          [True,  True],
          [True, False],
          [False, True],
          [True, False],
      ]
      """
      # https://stackoverflow.com/a/6811241
      shape = a.shape[:-1] + (a.shape[-1] - window + 1, window)
      strides = a.strides + (a.strides[-1],)
      return np.lib.stride_tricks.as_strided(
          a, shape=shape, strides=strides
      )
  
imports: from distutils.version import LooseVersion
  import operator
  import numpy
  from pandas._libs import algos, lib
  from pandas.compat import range, string_types
  from pandas.core.dtypes.cast import infer_dtype_from_array
  from pandas.core.dtypes.common import ensure_float64, is_datetime64_dtype, is_datetime64tz_dtype, is_float_dtype, is_integer, is_integer_dtype, is_numeric_v_string_like, is_scalar, is_timedelta64_dtype, needs_i8_conversion
  from pandas.core.dtypes.missing import isna
label_desc: Use image node_id 21 for calling a global function with example usage: _rolling_window(a, window) and returns: np