code: def _raw_fftnd(x, s, axes, direction, overwrite_x, work_function):
      """Internal auxiliary function for fftnd, ifftnd."""
      noaxes = axes is None
      s, axes = _init_nd_shape_and_axes_sorted(x, s, axes)
  
      # No need to swap axes, array is in C order
      if noaxes:
          for ax in axes:
              x, copy_made = _fix_shape(x, s[ax], ax)
              overwrite_x = overwrite_x or copy_made
          return work_function(x, s, direction, overwrite_x=overwrite_x)
  
      # Swap the request axes, last first (i.e. First swap the axis which ends up
      # at -1, then at -2, etc...), such as the request axes on which the
      # operation is carried become the last ones
      for i in range(1, axes.size + 1):
          x = numpy.swapaxes(x, axes[-i], -i)
  
      # We can now operate on the axes waxes, the p last axes (p = len(axes)), by
      # fixing the shape of the input array to 1 for any axis the fft is not
      # carried upon.
      waxes = list(range(x.ndim - axes.size, x.ndim))
      shape = numpy.ones(x.ndim)
      shape[waxes] = s
  
      for i in range(len(waxes)):
          x, copy_made = _fix_shape(x, s[i], waxes[i])
          overwrite_x = overwrite_x or copy_made
  
      r = work_function(x, shape, direction, overwrite_x=overwrite_x)
  
      # reswap in the reverse order (first axis first, etc...) to get original
      # order
      for i in range(len(axes), 0, -1):
          r = numpy.swapaxes(r, -i, axes[-i])
  
      return r
  
imports: from __future__ import division, print_function, absolute_import
  from numpy import swapaxes, zeros
  import numpy
  from .None import _fftpack
  from scipy.fftpack.helper import _init_nd_shape_and_axes_sorted
  import atexit
label_desc: Use image node_id 15 for calling a global function with example usage: _raw_fftnd(x, s, axes, direction, overwrite_x, work_function) and returns: r, work_function