original_docstring: 
      Resize `img' by cropping or expanding the image from the center. The `resizeDims' values are the output dimensions
      (or None to use original dimension of `img'). If a dimension is smaller than that of `img' then the result will be
      cropped and if larger padded with zeros, in both cases this is done relative to the center of `img'. The result is
      a new image with the specified dimensions and values from `img' copied into its center.
      
docstring: Resize `img' by cropping or expanding the image from the center. The `resizeDims' values are the output dimensions
  (or None to use original dimension of `img'). If a dimension is smaller than that of `img' then the result will be
  cropped and if larger padded with zeros, in both cases this is done relative to the center of `img'. The result is
  a new image with the specified dimensions and values from `img' copied into its center.
docstring_tokens: Resize ` img ' by cropping or expanding the image from the center . The ` resizeDims ' values are the output dimensions ( or None to use original dimension of ` img ' ) . If a dimension is smaller than that of ` img ' then the result will be cropped and if larger padded with zeros in both cases this is done relative to the center of ` img ' . The result is a new image with the specified dimensions and values from ` img ' copied into its center .
code: def resize_center(img, *resize_dims, fill_value=0):
      """
      Resize `img' by cropping or expanding the image from the center. The `resizeDims' values are the output dimensions
      (or None to use original dimension of `img'). If a dimension is smaller than that of `img' then the result will be
      cropped and if larger padded with zeros, in both cases this is done relative to the center of `img'. The result is
      a new image with the specified dimensions and values from `img' copied into its center.
      """
      resize_dims = tuple(resize_dims[i] or img.shape[i] for i in range(len(resize_dims)))
  
      dest = np.full(resize_dims, fill_value, img.dtype)
      half_img_shape = np.asarray(img.shape) // 2
      half_dest_shape = np.asarray(dest.shape) // 2
  
      srcslices, destslices = copypaste_arrays(img, dest, half_img_shape, half_dest_shape, resize_dims)
      dest[destslices] = img[srcslices]
  
      return dest
code_tokens: def resize_center ( img , * resize_dims , fill_value = 0 ) : resize_dims = tuple ( resize_dims [ i ] or img . shape [ i ] for i in range ( len ( resize_dims ) ) ) dest = np . full ( resize_dims , fill_value , img . dtype ) half_img_shape = np . asarray ( img . shape ) // 2 half_dest_shape = np . asarray ( dest . shape ) // 2 srcslices , destslices = copypaste_arrays ( img , dest , half_img_shape , half_dest_shape , resize_dims ) dest [ destslices ] = img [ srcslices ] return dest
short_docstring: Resize `img' by cropping or expanding the image from the center.
short_docstring_tokens: Resize ` img ' by cropping or expanding the image from the center .
comment: """
      Resize `img' by cropping or expanding the image from the center. The `resizeDims' values are the output dimensions
      (or None to use original dimension of `img'). If a dimension is smaller than that of `img' then the result will be
      cropped and if larger padded with zeros, in both cases this is done relative to the center of `img'. The result is
      a new image with the specified dimensions and values from `img' copied into its center.
      """