code: def find_measurable_comparisons(
      fgraph: FunctionGraph, node: Node
  ) -> Optional[List[MeasurableComparison]]:
      rv_map_feature: Optional[PreserveRVMappings] = getattr(
          fgraph, "preserve_rv_mappings", None
      )
      if rv_map_feature is None:
          return None  # pragma: no cover
  
      measurable_inputs = rv_map_feature.request_measurable(node.inputs)
  
      if len(measurable_inputs) != 1:
          return None
  
      # Make the measurable base_var always be the first input to the MeasurableComparison node
      [measurable_var] = measurable_inputs
      measurable_var_idx = node.inputs.index(measurable_var)
  
      # deny broadcasting of the measurable input
      if (
          measurable_var.type.broadcastable
          != node.outputs[0].type.broadcastable
      ):
          return None
  
      # Check that the other input is not potentially measurable, in which case this rewrite
      # would be invalid
      const = node.inputs[(measurable_var_idx + 1) % 2]
  
      # check for potential measurability of const
      if check_potential_measurability(
          [const], rv_map_feature.rv_values.keys()
      ):
          return None
  
      node_scalar_op = node.op.scalar_op
  
      # Change the Op if the base_var is the second input in node.inputs. e.g. pt.lt(const, dist) -> pt.gt(dist, const)
      if measurable_var_idx == 1:
          if isinstance(node_scalar_op, LT):
              node_scalar_op = GT()
          elif isinstance(node_scalar_op, GT):
              node_scalar_op = LT()
          elif isinstance(node_scalar_op, GE):
              node_scalar_op = LE()
          elif isinstance(node_scalar_op, LE):
              node_scalar_op = GE()
  
      compared_op = MeasurableComparison(node_scalar_op)
      compared_rv = compared_op.make_node(
          measurable_var, const
      ).default_output()
      return [compared_rv]
  
file_path: pymc/pymc/logprob/binary.py
imports: from typing import List, Optional
  import numpy
  import pytensor.tensor
  from pytensor.graph.basic import Node
  from pytensor.graph.fg import FunctionGraph
  from pytensor.graph.rewriting.basic import node_rewriter
  from pytensor.scalar.basic import GE, GT, LE, LT, Invert
  from pytensor.tensor.math import ge, gt, invert, le, lt
  from pymc.logprob.abstract import MeasurableElemwise, _logcdf_helper, _logprob, _logprob_helper
  from pymc.logprob.rewriting import PreserveRVMappings, measurable_ir_rewrites_db
  from pymc.logprob.utils import check_potential_measurability
label_desc: Use image node_id 1 for calling a global function with example usage: find_measurable_comparisons(fgraph, node) and returns: list, None, None, None, None