code: def test_group_by_dynamic_iter(
      every: str | timedelta, tzinfo: ZoneInfo | None
  ) -> None:
      time_zone = tzinfo.key if tzinfo is not None else None
      df = pl.DataFrame(
          {
              "datetime": [
                  datetime(2020, 1, 1, 10, 0),
                  datetime(2020, 1, 1, 10, 50),
                  datetime(2020, 1, 1, 11, 10),
              ],
              "a": [1, 2, 2],
              "b": [4, 5, 6],
          }
      ).set_sorted("datetime")
      df = df.with_columns(
          pl.col("datetime").dt.replace_time_zone(time_zone)
      )
  
      # Without 'by' argument
      result1 = [
          (name, data.shape)
          for name, data in df.group_by_dynamic(
              "datetime", every=every, closed="left"
          )
      ]
      expected1 = [
          (datetime(2020, 1, 1, 10, tzinfo=tzinfo), (2, 3)),
          (datetime(2020, 1, 1, 11, tzinfo=tzinfo), (1, 3)),
      ]
      assert result1 == expected1
  
      # With 'by' argument
      result2 = [
          (name, data.shape)
          for name, data in df.group_by_dynamic(
              "datetime", every=every, closed="left", by="a"
          )
      ]
      expected2 = [
          ((1, datetime(2020, 1, 1, 10, tzinfo=tzinfo)), (1, 3)),
          ((2, datetime(2020, 1, 1, 10, tzinfo=tzinfo)), (1, 3)),
          ((2, datetime(2020, 1, 1, 11, tzinfo=tzinfo)), (1, 3)),
      ]
      assert result2 == expected2
  
imports: from __future__ import annotations
  import sys
  from datetime import date, datetime, timedelta
  from typing import TYPE_CHECKING, Any
  import numpy
  import pytest
  import polars
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 26 for calling a global function with example usage: test_group_by_dynamic_iter(every, tzinfo) without return types