code: def test_groupby(env_async, items):
      tmpl = env_async.from_string(
          """
      {%- for grouper, list in items()|groupby('foo') -%}
          {{ grouper }}{% for x in list %}: {{ x.foo }}, {{ x.bar }}{% endfor %}|
      {%- endfor %}"""
      )
      assert tmpl.render(items=items).split("|") == [
          "1: 1, 2: 1, 1",
          "2: 2, 3",
          "3: 3, 4",
          "",
      ]
  
imports: from collections import namedtuple
  import pytest
  from markupsafe import Markup
  from jinja2 import Environment
  from jinja2.async_utils import auto_aiter
label_desc: Use image node_id 4 for calling a global function with example usage: test_groupby(env_async, items) without return types