def _check_is_permutation(indices, n_samples):
 if (len(indices) != n_samples):
  return False
 hit = np.zeros(n_samples, dtype=bool)
 hit[indices] = True
 if (not np.all(hit)):
  return False
 return True

def _check_is_permutation ( indices , n_samples ) : if ( len ( indices ) != n_samples ) : return False hit = np . zeros ( n_samples , dtype = bool ) hit [ indices ] = True if ( not np . all ( hit ) ) : return False return True
check whether indices is a reordering of the array np .