def _kpoints(data, k):
 if (data.ndim > 1):
  n = data.shape[0]
 else:
  n = data.size
 p = np.random.permutation(n)
 x = data[p[:k], :].copy()
 return x

def _kpoints ( data , k ) : if ( data . ndim > 1 ) : n = data . shape [ 0 ] else : n = data . size p = np . random . permutation ( n ) x = data [ p [ : k ] , : ] . copy ( ) return x
pick k points at random in data .