def _cplxpair(z, tol=None):
 z = atleast_1d(z)
 if ((z.size == 0) or np.isrealobj(z)):
  return np.sort(z)
 if (z.ndim != 1):
  raise ValueError('z must be 1-dimensional')
 (zc, zr) = _cplxreal(z, tol)
 zc = np.dstack((zc.conj(), zc)).flatten()
 z = np.append(zc, zr)
 return z

def _cplxpair ( z , tol = None ) : z = atleast_1d ( z ) if ( ( z . size == 0 ) or np . isrealobj ( z ) ) : return np . sort ( z ) if ( z . ndim != 1 ) : raise ValueError ( 'z must be 1-dimensional' ) ( zc , zr ) = _cplxreal ( z , tol ) zc = np . dstack ( ( zc . conj ( ) , zc ) ) . flatten ( ) z = np . append ( zc , zr ) return z
sort into pairs of complex conjugates .