code: def test_group_by_list_column() -> None:
      df = (
          pl.DataFrame({"a": ["a", "b", "a"]})
          .with_columns(pl.col("a").cast(pl.Categorical))
          .group_by("a", maintain_order=True)
          .agg(pl.col("a").alias("a_list"))
      )
  
      assert df.group_by("a_list", maintain_order=True).first().to_dict(
          as_series=False
      ) == {
          "a_list": [["a", "a"], ["b"]],
          "a": ["a", "b"],
      }
  
imports: from __future__ import annotations
  import pickle
  from datetime import date, datetime, time
  from typing import TYPE_CHECKING, Any
  import pandas
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 12 for calling a global function with example usage: test_group_by_list_column() without return types