code: def _str_for_input_rv(var: Variable, formatting: str) -> str:
      _str = (
          var.name
          if var.name is not None
          else str_for_dist(
              var, formatting=formatting, include_params=True
          )
      )
      if "latex" in formatting:
          return _latex_text_format(_latex_escape(_str.strip("$")))
      else:
          return _str
  
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 5 for calling a global function with example usage: _str_for_input_rv(var, formatting) and returns: _latex_text_format, _str