code: def test_cse_expr_group_by() -> None:
      q = pl.LazyFrame(
          {
              "a": [1, 2, 3, 4],
              "b": [1, 2, 3, 4],
              "c": [1, 2, 3, 4],
          }
      )
  
      derived = pl.col("a") * pl.col("b")
  
      q = (
          q.group_by("a")
          .agg(derived.sum().alias("sum"), derived.min().alias("min"))
          .sort("min")
      )
  
      assert "__POLARS_CSER" in q.explain(
          comm_subexpr_elim=True, optimized=True
      )
  
      s = q.explain(
          comm_subexpr_elim=True,
          optimized=True,
          streaming=True,
          comm_subplan_elim=False,
      )
      # check if it uses CSE_expr
      # and is a complete pipeline
      assert "__POLARS_CSER" in s
      assert s.startswith("--- STREAMING")
  
      expected = pl.DataFrame(
          {
              "a": [1, 2, 3, 4],
              "sum": [1, 4, 9, 16],
              "min": [1, 4, 9, 16],
          }
      )
      for streaming in [True, False]:
          out = q.collect(comm_subexpr_elim=True, streaming=streaming)
          assert_frame_equal(out, expected)
  
imports: from __future__ import annotations
  from typing import Any
  import pytest
  import polars
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 2 for calling a global function with example usage: test_cse_expr_group_by() without return types