def _set_group_selection(self):
grp = self.grouper<EOL>if not (self.as_index and<EOL>getattr(grp, '<STR_LIT>', None) is not None and<EOL>self.obj.ndim > <NUM_LIT:1> and<EOL>self._group_selection is None):<EOL><INDENT>return<EOL><DEDENT>ax = self.obj._info_axis<EOL>groupers = [g.name for g in grp.groupings<EOL>if g.level is None and g.in_axis]<EOL>if len(groupers):<EOL><INDENT>self._group_selection = ax.difference(Index(groupers),<EOL>sort=False).tolist()<EOL>self._reset_cache('<STR_LIT>')<EOL><DEDENT>
Create group based selection.

Used when selection is not passed directly but instead via a grouper.

NOTE: this should be paired with a call to _reset_group_selection