code: def _init_nd_and_axes(x, axes):
      # See documentation in scipy.fft._helper._init_nd_shape_and_axes
      # except shape argument is always None and doesn't return new shape
      axes = internal._normalize_axis_indices(
          axes, x.ndim, sort_axes=False
      )
      if not len(axes):
          raise ValueError("when provided, axes cannot be empty")
      if any(x.shape[ax] < 1 for ax in axes):
          raise ValueError("invalid number of data points specified")
      return axes
  
file_path: cupy/cupyx/scipy/signal/_signaltools_core.py
imports: import math
  import cupy
  from cupy._core import internal
  from cupyx.scipy import fft
  from cupyx.scipy.ndimage import _filters
  from cupyx.scipy.ndimage import _util
label_desc: Use image node_id 6 for calling a global function with example usage: _init_nd_and_axes(x, axes) and returns: axes