def METHOD_NAME(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)]