@final
def apply(self, f: Callable, data: (DataFrame | Series), axis: int=0) -> tuple[(list, bool)]:
    mutated = self.mutated
    splitter = self._get_splitter(data, axis=axis)
    group_keys = self.group_keys_seq
    result_values = []
    zipped = zip(group_keys, splitter)
    for (key, group) in zipped:
        object.__setattr__(group, 'name', key)
        group_axes = group.axes
        res = f(group)
        if ((not mutated) and (not _is_indexed_like(res, group_axes, axis))):
            mutated = True
        result_values.append(res)
    if ((len(group_keys) == 0) and (getattr(f, '__name__', None) not in ['idxmin', 'idxmax', 'nanargmin', 'nanargmax'])):
        f(data.iloc[:0])
    return (result_values, mutated)
@final
def apply(self, f: Callable, data: (DataFrame | Series), axis: int=0) -> tuple[(list, bool)]:
    mutated = self.mutated
    splitter = self._get_splitter(data, axis=axis)
    group_keys = self.group_keys_seq
    result_values = []
    zipped = zip(group_keys, splitter)
    for (key, group) in zipped:
        object.__setattr__(group, 'name', key)
        group_axes = group.axes
        res = f(group)
        if ((not mutated) and (not _is_indexed_like(res, group_axes, axis))):
            mutated = True
        result_values.append(res)
    if ((len(group_keys) == 0) and (getattr(f, '__name__', None) not in ['idxmin', 'idxmax', 'nanargmin', 'nanargmax'])):
        f(data.iloc[:0])
    return (result_values, mutated)