code: def test_group_by() -> None:
      df = pl.DataFrame(
          {
              "a": ["a", "b", "a", "b", "b", "c"],
              "b": [1, 2, 3, 4, 5, 6],
              "c": [6, 5, 4, 3, 2, 1],
          }
      )
  
      # Use lazy API in eager group_by
      assert sorted(df.group_by("a").agg([pl.sum("b")]).rows()) == [
          ("a", 4),
          ("b", 11),
          ("c", 6),
      ]
      # test if it accepts a single expression
      assert df.group_by("a", maintain_order=True).agg(
          pl.sum("b")
      ).rows() == [
          ("a", 4),
          ("b", 11),
          ("c", 6),
      ]
  
      df = pl.DataFrame(
          {
              "a": [1, 2, 3, 4, 5],
              "b": ["a", "a", "b", "b", "b"],
              "c": [None, 1, None, 1, None],
          }
      )
  
      # check if this query runs and thus column names propagate
      df.group_by("b").agg(pl.col("c").forward_fill()).explode("c")
  
      # get a specific column
      result = df.group_by("b", maintain_order=True).agg(pl.count("a"))
      assert result.rows() == [("a", 2), ("b", 3)]
      assert result.columns == ["b", "a"]
  
imports: from __future__ import annotations
  from collections import OrderedDict
  from datetime import datetime, timedelta
  from typing import Any
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 1 for calling a global function with example usage: test_group_by() without return types