code: def test_escape():
      assert escape(":ref:`id`") == r"\:ref\:\`id\`"
      assert escape("footnote [#]_") == r"footnote \[\#\]\_"
      assert escape("sphinx.application") == r"sphinx.application"
      assert escape(".. toctree::") == r"\.. toctree\:\:"
  
file_path: sphinx/tests/test_util/test_util_rst.py
imports: from docutils.statemachine import StringList
  from jinja2 import Environment
  from sphinx.util.rst import append_epilog, escape, heading, prepend_prolog, textwidth
label_desc: Use image node_id 1 for calling a global function with example usage: test_escape() without return types