class_docstr: A dynamic grouper.
  
  This has an `.agg` method which allows you to run all polars expressions in a
  group by context.
class_docstr_tok: ["A","dynamic","grouper",".","This","has","an","`",".agg","`","method","which","allows","you","to","run","all","polars","expressions","in","a","group","by","context","."]
code: def __next__(
      self,
  ) -> tuple[object, DataFrame] | tuple[tuple[object, ...], DataFrame]:
      if self._current_index >= len(self._group_indices):
          raise StopIteration
  
      group_name = next(self._group_names)
      group_data = self.df[self._group_indices[self._current_index]]
      self._current_index += 1
  
      return group_name, group_data
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Callable, Iterable, Iterator
  import polars._reexport
  from polars import functions
  from polars.utils.convert import _timedelta_to_pl_duration
  from polars.utils.deprecation import deprecate_renamed_function
label_desc: Use image node_id 3 for calling the DynamicGroupBy obj's underlying member method code with example usage: obj.__next__() and returns: group_name,  group_data