code: def test_groupby_multidot(env_async, articles):
      tmpl = env_async.from_string(
          """
      {%- for year, list in articles()|groupby('date.year') -%}
          {{ year }}{% for x in list %}[{{ x.title }}]{% endfor %}|
      {%- endfor %}"""
      )
      assert tmpl.render(articles=articles).split("|") == [
          "1970[aha][interesting][really?]",
          "1971[totally not]",
          "",
      ]
  
imports: from collections import namedtuple
  import pytest
  from jinja2 import Environment
  from jinja2.utils import Markup
label_desc: Use image node_id 7 for calling a global function with example usage: test_groupby_multidot(env_async, articles) without return types