parameters: (a, window)
return_statement: return np.lib.stride_tricks.as_strided(a, shape=shape, strides=strides)
docstring: [True, True, False, True, False], 2 ->
  
      [
          [True,  True],
          [True, False],
          [False, True],
          [True, False],
      ]
docstring_summary: [True, True, False, True, False], 2 ->
docstring_tokens: [ True True False True False ] 2 - >
function: 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)
function_tokens: def _rolling_window ( a , window ) : # 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 )