def _fix_shape(x, n, axis):
 s = list(x.shape)
 if (s[axis] > n):
  index = ([slice(None)] * len(s))
  index[axis] = slice(0, n)
  x = x[index]
  return (x, False)
 else:
  index = ([slice(None)] * len(s))
  index[axis] = slice(0, s[axis])
  s[axis] = n
  z = zeros(s, x.dtype.char)
  z[index] = x
  return (z, True)

def _fix_shape ( x , n , axis ) : s = list ( x . shape ) if ( s [ axis ] > n ) : index = ( [ slice ( None ) ] * len ( s ) ) index [ axis ] = slice ( 0 , n ) x = x [ index ] return ( x , False ) else : index = ( [ slice ( None ) ] * len ( s ) ) index [ axis ] = slice ( 0 , s [ axis ] ) s [ axis ] = n z = zeros ( s , x . dtype . char ) z [ index ] = x return ( z , True )
internal auxiliary function for _raw_fft .