class_docstr: Base object for permutations test
class_docstr_tok: ["Base","object","for","permutations","test"]
docstr: Return a shuffled copy of y eventually shuffle among same groups.
docstr_tok: ["Return","a","shuffled","copy","of","y","eventually","shuffle","among","same","groups","."]
code: def _shuffle(self, y, groups, rs):
      """Return a shuffled copy of y eventually shuffle among same groups."""
      if groups is None:
          indices = rs.permutation(len(y))
      else:
          indices = np.arange(len(groups))
          for group in np.unique(groups):
              this_mask = groups == group
              indices[this_mask] = rs.permutation(indices[this_mask])
      return y[indices]
  
imports: import sys
  import math
  import numpy
  from .utils.utils import check_version
  from .utils.distance import distance, pairwise_distance
  from .utils.mean import mean_covariance
  from .classification import MDM, _check_metric
label_desc: Use image node_id 4 for calling the BasePermutation obj's underlying member method code with example usage: obj._shuffle(y, groups, rs) and returns: y