code: def expand_window(center, window_size, array_size):
      
      if center - window_size < 0:
          lower = 0
      else:
          lower = center - window_size
      if center + window_size + 1 > array_size:
          upper = array_size
      else:
          upper = center + window_size + 1
      return np.array(range(lower, upper))
docs: Generate a bounded windows. 
  
      maxlength = 2 * window_size + 1, lower bound is 0 and upper bound is 
      ``array_size - 1``.
  
      Example::
  
          >>> expand_window(center=50, window_size=3, max=100)
          [47, 48, 49, 50, 51, 52, 53]
  
          >>> expand_window(center=2, window_size=3, max=100)
          [0, 1, 2, 3, 4, 5]
  
          >>> expand_window(center=98, window_size=3, max=100)
          [95, 96, 97, 98, 99]