code: def test_trailing_comma_with_context(self, test_env):
      test_env.from_string(
          '{% from "foo" import bar, baz with context %}'
      )
      test_env.from_string(
          '{% from "foo" import bar, baz, with context %}'
      )
      test_env.from_string('{% from "foo" import bar, with context %}')
      test_env.from_string('{% from "foo" import bar, with, context %}')
      test_env.from_string(
          '{% from "foo" import bar, with with context %}'
      )
  
      with pytest.raises(TemplateSyntaxError):
          test_env.from_string(
              '{% from "foo" import bar,, with context %}'
          )
  
      with pytest.raises(TemplateSyntaxError):
          test_env.from_string(
              '{% from "foo" import bar with context, %}'
          )
  
imports: import pytest
  from jinja2 import DictLoader
  from jinja2 import Environment
  from jinja2.exceptions import TemplateNotFound
  from jinja2.exceptions import TemplatesNotFound
  from jinja2.exceptions import TemplateSyntaxError
label_desc: Use image node_id 4 for calling the TestImports obj's underlying member method code with example usage: obj.test_trailing_comma_with_context(test_env) without return types