code: def test_group_by_flatten_string() -> None:
      df = pl.DataFrame(
          {"group": ["a", "b", "b"], "values": ["foo", "bar", "baz"]}
      )
      result = df.group_by("group", maintain_order=True).agg(
          pl.col("values").str.explode()
      )
  
      expected = pl.DataFrame(
          {
              "group": ["a", "b"],
              "values": [
                  ["f", "o", "o"],
                  ["b", "a", "r", "b", "a", "z"],
              ],
          }
      )
      assert_frame_equal(result, expected)
  
imports: from __future__ import annotations
  import pyarrow
  import pytest
  import polars
  import polars.selectors
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 4 for calling a global function with example usage: test_group_by_flatten_string() without return types