code: def compile(
      expression: str,
      escape_funcs: EscapeFuncDict | None = None,
      unescape_funcs: EscapeFuncDict | None = None,
  ) -> _CompiledGrammar:
      """
      Compile grammar (given as regex string), returning a `CompiledGrammar`
      instance.
      """
      return _compile_from_parse_tree(
          parse_regex(tokenize_regex(expression)),
          escape_funcs=escape_funcs,
          unescape_funcs=unescape_funcs,
      )
  
imports: from __future__ import annotations
  import re
  from typing import Callable, Dict, Iterable, Iterator, Pattern
  from typing import Match
  from .regex_parser import AnyNode, Lookahead, Node, NodeSequence, Regex, Repeat, Variable, parse_regex, tokenize_regex
label_desc: Use image node_id 1 for calling a global function with example usage: compile(expression, escape_funcs, unescape_funcs) and returns: _compile_from_parse_tree