code: def icdf(
      rv: TensorVariable, value: TensorLike, warn_rvs=None, **kwargs
  ) -> TensorVariable:
      """Create a graph for the inverse CDF of a random variable.
  
      Parameters
      ----------
      rv : TensorVariable
      value : tensor_like
          Should be the same type (shape and dtype) as the rv.
      warn_rvs : bool, default True
          Warn if RVs were found in the icdf graph.
          This can happen when a variable has other random variables as inputs.
          In that case, those random variables should be replaced by their respective values.
  
      Returns
      -------
      icdf : TensorVariable
  
      Raises
      ------
      RuntimeError
          If the icdf cannot be derived.
  
      Examples
      --------
      Create a compiled function that evaluates the icdf of a variable
  
      .. code-block:: python
  
          import pymc as pm
          import pytensor.tensor as pt
  
          mu = pt.scalar("mu")
          rv = pm.Normal.dist(mu, 1.0)
  
          value = pt.scalar("value")
          rv_icdf = pm.icdf(rv, value)
  
          # Use .eval() for debugging
          print(rv_icdf.eval({value: 0.9, mu: 0.0}))  # 1.28155157
  
          # Compile a function for repeated evaluations
          rv_icdf_fn = pm.compile_pymc([value, mu], rv_icdf)
          print(rv_icdf_fn(value=0.9, mu=0.0))  # 1.28155157
  
  
      Derive the graph for a transformation of a RandomVariable
  
      .. code-block:: python
  
          import pymc as pm
          import pytensor.tensor as pt
  
          mu = pt.scalar("mu")
          rv = pm.Normal.dist(mu, 1.0)
          exp_rv = pt.exp(rv)
  
          value = pt.scalar("value")
          exp_rv_icdf = pm.icdf(exp_rv, value)
  
          # Use .eval() for debugging
          print(exp_rv_icdf.eval({value: 0.9, mu: 0.0}))  # 3.60222448
  
          # Compile a function for repeated evaluations
          exp_rv_icdf_fn = pm.compile_pymc([value, mu], exp_rv_icdf)
          print(exp_rv_icdf_fn(value=0.9, mu=0.0))  # 3.60222448
  
      """
      warn_rvs, kwargs = _deprecate_warn_missing_rvs(warn_rvs, kwargs)
      value = pt.as_tensor_variable(value, dtype="floatX")
      try:
          return _icdf_helper(rv, value, **kwargs)
      except NotImplementedError:
          # Try to rewrite rv
          fgraph, rv_values, _ = construct_ir_fgraph({rv: value})
          [ir_rv] = fgraph.outputs
          expr = _icdf_helper(ir_rv, value, **kwargs)
          cleanup_ir([expr])
          if warn_rvs:
              _warn_rvs_in_inferred_graph(expr)
          return expr
  
imports: import warnings
  from collections import deque
  from typing import Dict, List, Optional, Sequence, Union
  import numpy
  import pytensor.tensor
  from pytensor import config
  from pytensor.graph.basic import Constant, Variable, ancestors, graph_inputs, io_toposort
  from pytensor.graph.op import compute_test_value
  from pytensor.graph.rewriting.basic import GraphRewriter, NodeRewriter
  from pytensor.tensor.variable import TensorVariable
  from typing_extensions import TypeAlias
  from pymc.logprob.abstract import MeasurableVariable, _icdf_helper, _logcdf_helper, _logprob, _logprob_helper
  from pymc.logprob.rewriting import cleanup_ir, construct_ir_fgraph
  from pymc.logprob.transform_value import TransformValuesRewrite
  from pymc.logprob.transforms import Transform
  from pymc.logprob.utils import rvs_in_graph
  from pymc.pytensorf import replace_vars_in_graphs
label_desc: Use image node_id 6 for calling a global function with example usage: icdf(rv, value, warn_rvs) and returns: _icdf_helper, expr