code: def logprob_check_and_raise(
      op, values, inner_rv, *assertions, **kwargs
  ):
      (value,) = values
      # transfer assertion from rv to value
      assertions = replace_rvs_by_values(
          assertions, rvs_to_values={inner_rv: value}
      )
      value = op(value, *assertions)
      return _logprob_helper(inner_rv, value)
  
file_path: pymc/pymc/logprob/checks.py
imports: from typing import List, Optional
  import pytensor.tensor
  from pytensor.graph.rewriting.basic import node_rewriter
  from pytensor.raise_op import CheckAndRaise
  from pytensor.tensor.shape import SpecifyShape
  from pymc.logprob.abstract import MeasurableVariable, _logprob, _logprob_helper
  from pymc.logprob.rewriting import PreserveRVMappings, measurable_ir_rewrites_db
  from pymc.logprob.utils import replace_rvs_by_values
label_desc: Use image node_id 3 for calling a global function with example usage: logprob_check_and_raise(op, values, inner_rv) and returns: _logprob_helper