code: def test_duplicate_required_or_scoped(self, env):
      env = Environment(
          loader=DictLoader(
              {
                  "default1": "{% for item in seq %}[{% block item "
                  "scoped scoped %}}{{% endblock %}}]{{% endfor %}}",
                  "default2": "{% for item in seq %}[{% block item "
                  "required required %}}{{% endblock %}}]{{% endfor %}}",
                  "child": "{% if default %}{% extends default %}{% else %}"
                  "{% extends 'default1' %}{% endif %}{%- block x %}"
                  "CHILD{% endblock %}",
              }
          )
      )
      tmpl = env.get_template("child")
      with pytest.raises(TemplateSyntaxError):
          tmpl.render(default="default1", seq=list(range(3)))
          tmpl.render(default="default2", seq=list(range(3)))
  
imports: import pytest
  from jinja2 import DictLoader
  from jinja2 import Environment
  from jinja2 import TemplateRuntimeError
  from jinja2 import TemplateSyntaxError
label_desc: Use image node_id 20 for calling the TestInheritance obj's underlying member method code with example usage: obj.test_duplicate_required_or_scoped(env) without return types