code: def _centered(arr, newshape):
      # Return the center newshape portion of the array.
      currshape = arr.shape
      startind = (currshape - newshape) // 2
      endind = startind + newshape
      myslice = [
          slice(startind[k], endind[k]) for k in range(len(endind))
      ]
      return arr[tuple(myslice)]
  
file_path: cusignal/python/cusignal/convolution/convolution_utils.py
imports: import timeit
  import cupy
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: _centered(arr, newshape) and returns: arr