code: def _format_exc_msg(exc: "ParseException"):
      from pyparsing import ParseException
  
      from dvc.utils import colorize
  
      exc.loc += (
          2  # 2 because we append `${` at the start of expr below
      )
  
      expr = exc.pstr
      exc.pstr = embrace(exc.pstr)
      error = ParseException.explain(exc, depth=0)
  
      _, pointer, *explains = error.splitlines()
      pstr = "{brace_open}{expr}{brace_close}".format(
          brace_open=colorize(BRACE_OPEN, color="blue"),
          expr=colorize(expr, color="magenta"),
          brace_close=colorize(BRACE_CLOSE, color="blue"),
      )
      msg = "\n".join(explains)
      pointer = colorize(pointer, color="red")
      return "\n".join(
          [pstr, pointer, colorize(msg, color="red", style="bold")]
      )
  
imports: import os
  import re
  import typing
  from collections.abc import Iterable, Mapping
  from functools import singledispatch
  from funcy import memoize, rpartial
  from dvc.exceptions import DvcException
  from dvc.utils.flatten import flatten
label_desc: Use image node_id 11 for calling a global function with example usage: _format_exc_msg(exc) and returns: str