code: def _good_shape(x, shape, axes):
      """Ensure that shape argument is valid for scipy.fftpack
  
      scipy.fftpack does not support len(shape) < x.ndim when axes is not given.
      """
      if shape is not None and axes is None:
          shape = _iterable_of_int(shape, "shape")
          if len(shape) != numpy.ndim(x):
              raise ValueError(
                  "when given, axes and shape arguments"
                  " have to be of the same length"
              )
      return shape
  
imports: import itertools
  import math
  from numbers import Number
  import operator
  from .None import numpy_fft
  from ..builders._utils import _default_effort, _default_threads, _cook_nd_args
  from ._utils import _Xfftn
  import numpy
  from scipy.fftpack import diff, tilbert, itilbert, hilbert, ihilbert, cs_diff, sc_diff, ss_diff, cc_diff, shift, fftshift, ifftshift, fftfreq, rfftfreq, convolve
  from ..pyfftw import next_fast_len
label_desc: Use image node_id 2 for calling a global function with example usage: _good_shape(x, shape, axes) and returns: shape