code: def str_for_dist(
      dist: TensorVariable,
      formatting: str = "plain",
      include_params: bool = True,
  ) -> str:
      """Make a human-readable string representation of a Distribution in a model, either
      LaTeX or plain, optionally with distribution parameter values included.
      """
  
      if include_params:
          # first 3 args are always (rng, size, dtype), rest is relevant for distribution
          if isinstance(dist.owner.op, RandomVariable):
              dist_args = [
                  _str_for_input_var(x, formatting=formatting)
                  for x in dist.owner.inputs[3:]
              ]
          else:
              dist_args = [
                  _str_for_input_var(x, formatting=formatting)
                  for x in dist.owner.inputs
                  if not isinstance(
                      x,
                      (
                          RandomStateSharedVariable,
                          RandomGeneratorSharedVariable,
                      ),
                  )
              ]
  
      print_name = dist.name
  
      if "latex" in formatting:
          if print_name is not None:
              print_name = (
                  r"\text{" + _latex_escape(dist.name.strip("$")) + "}"
              )
  
          op_name = (
              dist.owner.op._print_name[1]
              if hasattr(dist.owner.op, "_print_name")
              else r"\\operatorname{Unknown}"
          )
          if include_params:
              if print_name:
                  return r"${} \sim {}({})$".format(
                      print_name,
                      op_name,
                      ",~".join([d.strip("$") for d in dist_args]),
                  )
              else:
                  return r"${}({})$".format(
                      op_name,
                      ",~".join([d.strip("$") for d in dist_args]),
                  )
  
          else:
              if print_name:
                  return rf"${print_name} \sim {op_name}$"
              else:
                  return rf"${op_name}$"
  
      else:  # plain
          dist_name = (
              dist.owner.op._print_name[0]
              if hasattr(dist.owner.op, "_print_name")
              else "Unknown"
          )
          if include_params:
              if print_name:
                  return r"{} ~ {}({})".format(
                      print_name, dist_name, ", ".join(dist_args)
                  )
              else:
                  return r"{}({})".format(
                      dist_name, ", ".join(dist_args)
                  )
          else:
              if print_name:
                  return rf"{print_name} ~ {dist_name}"
              else:
                  return dist_name
  
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 1 for calling a global function with example usage: str_for_dist(dist, formatting, include_params) and returns: str, str, str, print_name, str, op_name, str, str, op_name, str, str, str, print_name, str, dist_name, dist_name