code: def test_ascii_str():
      @contextfilter
      def assert_func(context, value):
          assert type(value) is context["expected_type"]
  
      env = Environment()
      env.filters["assert"] = assert_func
  
      env.policies["compiler.ascii_str"] = False
      t = env.from_string('{{ "foo"|assert }}')
      t.render(expected_type=text_type)
  
      env.policies["compiler.ascii_str"] = True
      t = env.from_string('{{ "foo"|assert }}')
      t.render(expected_type=str)
  
      for val in True, False:
          env.policies["compiler.ascii_str"] = val
          t = env.from_string('{{ "\N{SNOWMAN}"|assert }}')
          t.render(expected_type=text_type)
  
file_path: catboost/contrib/python/Jinja2/py2/tests/test_features.py
imports: import sys
  import pytest
  from jinja2 import contextfilter
  from jinja2 import Environment
  from jinja2 import Template
  from jinja2._compat import text_type
label_desc: Use image node_id 2 for calling a global function with example usage: test_ascii_str() without return types