code: def find_constants(model: "Model") -> Dict[str, Var]:
      """If there are constants available, return them as a dictionary."""
  
      # The constant data vars must be either pm.Data or TensorConstant or SharedVariable
      def is_data(name, var, model) -> bool:
          observations = find_observations(model)
          return (
              var not in model.deterministics
              and var not in model.observed_RVs
              and var not in model.free_RVs
              and var not in model.potentials
              and var not in model.value_vars
              and name not in observations
              and isinstance(var, (Constant, SharedVariable))
          )
  
      # The assumption is that constants (like pm.Data) are named
      # variables that aren't observed or free RVs, nor are they
      # deterministics, and then we eliminate observations.
      constant_data = {}
      for name, var in model.named_vars.items():
          if is_data(name, var, model):
              if hasattr(var, "get_value"):
                  var = var.get_value()
              elif hasattr(var, "data"):
                  var = var.data
              constant_data[name] = var
  
      return constant_data
  
imports: import logging
  import warnings
  from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Mapping, Optional, Tuple, Union
  import numpy
  from arviz import InferenceData, concat, rcParams
  from arviz.data.base import CoordSpec, DimSpec, dict_to_dataset, requires
  from pytensor.graph.basic import Constant
  from pytensor.tensor.sharedvar import SharedVariable
  import pymc
  from pymc.model import Model, modelcontext
  from pymc.pytensorf import extract_obs_data
  from pymc.util import get_default_varnames
label_desc: Use image node_id 2 for calling a global function with example usage: find_constants(model) and returns: constant_data, unknown