code: def _get_kernel_size(kernel_size, ndim):
      if kernel_size is None:
          kernel_size = (3,) * ndim
      kernel_size = _util._fix_sequence_arg(
          kernel_size, ndim, "kernel_size", int
      )
      if any((k % 2) != 1 for k in kernel_size):
          raise ValueError("Each element of kernel_size should be odd")
      return kernel_size
  
imports: import warnings
  import cupy
  from cupy._core import internal
  from cupy.linalg import lstsq
  import cupyx.scipy.fft
  from cupyx.scipy.ndimage import _util
  from cupyx.scipy.ndimage import _filters
  from cupyx.scipy.signal import _signaltools_core
  from cupyx.scipy.signal._arraytools import const_ext, even_ext, odd_ext, axis_reverse, axis_slice, axis_assign
  from cupyx.scipy.signal._iir_utils import apply_iir, apply_iir_sos, compute_correction_factors, compute_correction_factors_sos
label_desc: Use image node_id 23 for calling a global function with example usage: _get_kernel_size(kernel_size, ndim) and returns: kernel_size