code: def check_parameters(
      expr: Variable,
      *conditions: Iterable[Variable],
      msg: str = "",
      can_be_replaced_by_ninf: bool = True,
  ):
      """Wrap an expression in a CheckParameterValue that asserts several conditions are met.
  
      When conditions are not met a ParameterValueError assertion is raised,
      with an optional custom message defined by `msg`.
  
      When the flag `can_be_replaced_by_ninf` is True (default), PyMC is allowed to replace the
      assertion by a switch(condition, expr, -inf). This is used for logp graphs!
  
      Note that check_parameter should not be used to enforce the logic of the
      expression under the normal parameter support as it can be disabled by the user via
      check_bounds = False in pm.Model()
      """
      # pt.all does not accept True/False, but accepts np.array(True)/np.array(False)
      conditions_ = [
          cond
          if (cond is not True and cond is not False)
          else np.array(cond)
          for cond in conditions
      ]
      all_true_scalar = pt.all([pt.all(cond) for cond in conditions_])
  
      return CheckParameterValue(msg, can_be_replaced_by_ninf)(
          expr, all_true_scalar
      )
  
imports: import warnings
  from functools import partial
  from typing import Iterable
  import numpy
  import pytensor
  import pytensor.tensor
  import scipy.linalg
  import scipy.stats
  from pytensor.graph.basic import Apply, Variable
  from pytensor.graph.op import Op
  from pytensor.scalar import UnaryScalarOp, upgrade_to_float_no_complex
  from pytensor.tensor import gammaln
  from pytensor.tensor.elemwise import Elemwise
  from pymc.distributions.shape_utils import to_tuple
  from pymc.logprob.utils import CheckParameterValue
  from pymc.pytensorf import floatX
label_desc: Use image node_id 1 for calling a global function with example usage: check_parameters(expr) and returns: CheckParameterValue