def _gotitem(self, key, ndim, subset=None):

        if ndim == 2:
            if subset is None:
                subset = self.obj
            return DataFrameGroupBy(subset, self.grouper, selection=key,
                                    grouper=self.grouper,
                                    exclusions=self.exclusions,
                                    as_index=self.as_index)
        elif ndim == 1:
            if subset is None:
                subset = self.obj[key]
            return SeriesGroupBy(subset, selection=key,
                                 grouper=self.grouper)

        raise AssertionError("invalid ndim for _gotitem")
Arguments:
dataset/ETHPy150Open pydata/pandas/pandas/core/groupby.py/DataFrameGroupBy._gotitem--crossover with--dataset/ETHPy150Open scanner/asimap/asimap/client.py/Authenticated.__init__