code: def find_measurable_stacks(
      fgraph, node
  ) -> Optional[List[Union[MeasurableMakeVector, MeasurableJoin]]]:
      r"""Finds `Joins`\s and `MakeVector`\s for which a `logprob` can be computed."""
  
      rv_map_feature: Optional[PreserveRVMappings] = getattr(
          fgraph, "preserve_rv_mappings", None
      )
  
      if rv_map_feature is None:
          return None  # pragma: no cover
  
      is_join = isinstance(node.op, Join)
  
      if is_join:
          axis, *base_vars = node.inputs
      else:
          base_vars = node.inputs
  
      valued_rvs = rv_map_feature.rv_values.keys()
      if not all(
          check_potential_measurability([base_var], valued_rvs)
          for base_var in base_vars
      ):
          return None
  
      base_vars = assume_measured_ir_outputs(valued_rvs, base_vars)
      if not all(
          var.owner and isinstance(var.owner.op, MeasurableVariable)
          for var in base_vars
      ):
          return None
  
      if is_join:
          measurable_stack = MeasurableJoin()(axis, *base_vars)
      else:
          measurable_stack = MeasurableMakeVector(node.op.dtype)(
              *base_vars
          )
  
      return [measurable_stack]
  
imports: from typing import List, Optional, Union
  import pytensor
  from pytensor import tensor
  from pytensor.graph.op import compute_test_value
  from pytensor.graph.rewriting.basic import node_rewriter
  from pytensor.tensor.basic import Alloc, Join, MakeVector
  from pytensor.tensor.elemwise import DimShuffle
  from pytensor.tensor.random.op import RandomVariable
  from pytensor.tensor.random.rewriting import local_dimshuffle_rv_lift, local_rv_size_lift
  from pymc.logprob.abstract import MeasurableVariable, _logprob, _logprob_helper
  from pymc.logprob.rewriting import PreserveRVMappings, assume_measured_ir_outputs, measurable_ir_rewrites_db
  from pymc.logprob.utils import check_potential_measurability, replace_rvs_by_values
  from pymc.pytensorf import constant_fold
label_desc: Use image node_id 4 for calling a global function with example usage: find_measurable_stacks(fgraph, node) and returns: list, None, None, None