code: def get_parent_names(self, var: TensorVariable) -> Set[VarName]:
      if var.owner is None or var.owner.inputs is None:
          return set()
  
      def _filter_non_parameter_inputs(var):
          node = var.owner
          if isinstance(node.op, Shape):
              # Don't show shape-related dependencies
              return []
          if isinstance(node.op, RandomVariable):
              # Filter out rng, dtype and size parameters or RandomVariable nodes
              return node.inputs[3:]
          else:
              # Otherwise return all inputs
              return node.inputs
  
      blockers = set(self.model.named_vars)
  
      def _expand(x):
          nonlocal blockers
          if x.name in blockers:
              return [x]
          if isinstance(x.owner, Apply):
              return reversed(_filter_non_parameter_inputs(x))
          return []
  
      parents = set()
      for x in walk(
          nodes=_filter_non_parameter_inputs(var), expand=_expand
      ):
          # Only consider nodes that are in the named model variables.
          vname = getattr(x, "name", None)
          if isinstance(vname, str) and vname in self._all_var_names:
              parents.add(VarName(vname))
  
      return parents
  
imports: import warnings
  from collections import defaultdict
  from typing import Dict, Iterable, List, Optional, Sequence, Set
  from pytensor import function
  from pytensor.compile.sharedvalue import SharedVariable
  from pytensor.graph import Apply
  from pytensor.graph.basic import ancestors, walk
  from pytensor.scalar.basic import Cast
  from pytensor.tensor.elemwise import Elemwise
  from pytensor.tensor.random.op import RandomVariable
  from pytensor.tensor.shape import Shape
  from pytensor.tensor.variable import TensorConstant, TensorVariable
  import pymc
  from pymc.util import VarName, get_default_varnames, get_var_name
label_desc: Use image node_id 2 for calling the ModelGraph obj's underlying member method code with example usage: obj.get_parent_names(var) and returns: parents, set, list, list, node, node, list, reversed