code: def _str_for_input_var(var: Variable, formatting: str) -> str:
      # Avoid circular import
      from pymc.distributions.distribution import SymbolicRandomVariable
  
      def _is_potential_or_deterministic(var: Variable) -> bool:
          try:
              return (
                  var.str_repr.__func__.func
                  is str_for_potential_or_deterministic
              )
          except AttributeError:
              # in case other code overrides str_repr, fallback
              return False
  
      if isinstance(var, (Constant, SharedVariable)):
          return _str_for_constant(var, formatting)
      elif isinstance(
          var.owner.op, (RandomVariable, SymbolicRandomVariable)
      ) or _is_potential_or_deterministic(var):
          # show the names for RandomVariables, Deterministics, and Potentials, rather
          # than the full expression
          return _str_for_input_rv(var, formatting)
      elif isinstance(var.owner.op, DimShuffle):
          return _str_for_input_var(var.owner.inputs[0], formatting)
      else:
          return _str_for_expression(var, formatting)
  
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 4 for calling a global function with example usage: _str_for_input_var(var, formatting) and returns: _str_for_constant, unknown, _str_for_input_rv, False, _str_for_input_var, _str_for_expression