def _raw_fft(x, n, axis, direction, overwrite_x, work_function):
 if (n is None):
  n = x.shape[axis]
 elif (n != x.shape[axis]):
  (x, copy_made) = _fix_shape(x, n, axis)
  overwrite_x = (overwrite_x or copy_made)
 if (n < 1):
  raise ValueError(('Invalid number of FFT data points (%d) specified.' % n))
 if ((axis == (-1)) or (axis == (len(x.shape) - 1))):
  r = work_function(x, n, direction, overwrite_x=overwrite_x)
 else:
  x = swapaxes(x, axis, (-1))
  r = work_function(x, n, direction, overwrite_x=overwrite_x)
  r = swapaxes(r, axis, (-1))
 return r

def _raw_fft ( x , n , axis , direction , overwrite_x , work_function ) : if ( n is None ) : n = x . shape [ axis ] elif ( n != x . shape [ axis ] ) : ( x , copy_made ) = _fix_shape ( x , n , axis ) overwrite_x = ( overwrite_x or copy_made ) if ( n < 1 ) : raise ValueError ( ( 'Invalid number of FFT data points (%d) specified.' % n ) ) if ( ( axis == ( - 1 ) ) or ( axis == ( len ( x . shape ) - 1 ) ) ) : r = work_function ( x , n , direction , overwrite_x = overwrite_x ) else : x = swapaxes ( x , axis , ( - 1 ) ) r = work_function ( x , n , direction , overwrite_x = overwrite_x ) r = swapaxes ( r , axis , ( - 1 ) ) return r
internal auxiliary function for fft .