code: def test_concat_list_in_agg_6397() -> None:
      df = pl.DataFrame(
          {"group": [1, 2, 2, 3], "value": ["a", "b", "c", "d"]}
      )
  
      # single list
      assert df.group_by("group").agg(
          [
              # this casts every element to a list
              pl.concat_list(pl.col("value")),
          ]
      ).sort("group").to_dict(as_series=False) == {
          "group": [1, 2, 3],
          "value": [[["a"]], [["b"], ["c"]], [["d"]]],
      }
  
      # nested list
      assert df.group_by("group").agg(
          [
              pl.concat_list(pl.col("value").implode()).alias("result"),
          ]
      ).sort("group").to_dict(as_series=False) == {
          "group": [1, 2, 3],
          "result": [[["a"]], [["b", "c"]], [["d"]]],
      }
  
imports: from __future__ import annotations
  from datetime import date, datetime
  from typing import TYPE_CHECKING
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 11 for calling a global function with example usage: test_concat_list_in_agg_6397() without return types