code: def _latex_escape(text: str) -> str:
      # Note that this is *NOT* a proper LaTeX escaper, on purpose. _repr_latex_ is
      # primarily used in the context of Jupyter notebooks, which render using MathJax.
      # MathJax is a subset of LaTeX proper, which expects only $ to be escaped. If we were
      # to also escape e.g. _ (replace with \_), then "\_" will show up in the output, etc.
      return text.replace("$", r"\$")
  
file_path: pymc/pymc/printing.py
imports: from typing import Union
  from pytensor.compile import SharedVariable
  from pytensor.graph.basic import Constant, walk
  from pytensor.tensor.basic import TensorVariable, Variable
  from pytensor.tensor.elemwise import DimShuffle
  from pytensor.tensor.random.basic import RandomVariable
  from pytensor.tensor.random.var import RandomGeneratorSharedVariable, RandomStateSharedVariable
  from pymc.model import Model
label_desc: Use image node_id 9 for calling a global function with example usage: _latex_escape(text) and returns: text