code: def get_pc_sampler(
      predictor_name,
      corrector_name,
      sde,
      score_fn,
      y,
      denoise=True,
      eps=3e-2,
      snr=0.1,
      corrector_steps=1,
      probability_flow: bool = False,
      intermediate=False,
      **kwargs,
  ):
      """Create a Predictor-Corrector (PC) sampler.
  
      Args:
          predictor_name: The name of a registered `sampling.Predictor`.
          corrector_name: The name of a registered `sampling.Corrector`.
          sde: An `sdes.SDE` object representing the forward SDE.
          score_fn: A function (typically learned model) that predicts the score.
          y: A `torch.Tensor`, representing the (non-white-)noisy starting point(s)
               to condition the prior on.
          denoise: If `True`, add one-step denoising to the final samples.
          eps: A `float` number. The reverse-time SDE and ODE are integrated to
              `epsilon` to avoid numerical issues.
          snr: The SNR to use for the corrector. 0.1 by default, and ignored for
              `NoneCorrector`.
          N: The number of reverse sampling steps. If `None`, uses the SDE's `N`
              property by default.
  
      Returns:
          A sampling function that returns samples and the number of function
           evaluations during sampling.
      """
      predictor_cls = predictor_dict[predictor_name]
      corrector_cls = corrector_dict[corrector_name]
      predictor = predictor_cls(
          sde, score_fn, probability_flow=probability_flow
      )
      corrector = corrector_cls(
          sde, score_fn, snr=snr, n_steps=corrector_steps
      )
  
      def pc_sampler():
          """The PC sampler function."""
          with torch.no_grad():
              xt = sde.prior_sampling(y.shape, y).to(y.device)
              timesteps = torch.linspace(
                  sde.T, eps, sde.N, device=y.device
              )
              for i in range(sde.N):
                  t = timesteps[i]
                  vec_t = torch.ones(y.shape[0], device=y.device) * t
                  xt, xt_mean = corrector.update_fn(xt, vec_t, y)
                  xt, xt_mean = predictor.update_fn(xt, vec_t, y)
              x_result = xt_mean if denoise else xt
              ns = sde.N * (corrector.n_steps + 1)
              return x_result, ns
  
      return pc_sampler
  
imports: import torch
  from scipy import integrate
  from .correctors import Corrector, corrector_dict
  from .predictors import Predictor, ReverseDiffusionPredictor, predictor_dict
label_desc: Use image node_id 3 for calling a global function with example usage: get_pc_sampler(predictor_name, corrector_name, sde, score_fn, y, denoise, eps, snr, corrector_steps, probability_flow, intermediate) and returns: pc_sampler, x_result,  ns