code: def test_iterator_not_advanced_early():
      t = Template(
          "{% for _, g in gs %}{{ loop.index }} {{ g|list }}\n{% endfor %}"
      )
      out = t.render(
          gs=itertools.groupby(
              [(1, "a"), (1, "b"), (2, "c"), (3, "d")], lambda x: x[0]
          )
      )
      # groupby groups depend on the current position of the iterator. If
      # it was advanced early, the lists would appear empty.
      assert (
          out == "1 [(1, 'a'), (1, 'b')]\n2 [(2, 'c')]\n3 [(3, 'd')]\n"
      )
  
file_path: catboost/contrib/python/Jinja2/py3/tests/test_runtime.py
imports: import itertools
  from jinja2 import Template
  from jinja2.runtime import LoopContext
label_desc: Use image node_id 6 for calling a global function with example usage: test_iterator_not_advanced_early() without return types