def METHOD_NAME(self, msg):
    name = msg["name"]
    fn = msg["fn"]
    value = msg["value"]
    is_observed = msg["is_observed"]
    if name not in self.guide.prototype_trace.nodes:
        return {"fn": fn, "value": value, "is_observed": is_observed}
    if is_observed:
        raise NotImplementedError(
            f"At pyro.sample({repr(name)},...), "
            "NeuTraReparam does not support observe statements."
        )
    log_density = 0.0
    compute_density = poutine.get_mask() is not False
    if name not in self.x_unconstrained:  # On first sample site.
        # Sample a shared latent.
        try:
            self.transform = self.guide.get_transform()
        except (NotImplementedError, TypeError) as e:
            raise ValueError(
                "NeuTraReparam only supports guides that implement "
                "`get_transform` method that does not depend on the "
                "model's `*args, **kwargs`"
            ) from e
        with ExitStack() as stack:
            for plate in self.guide.plates.values():
                stack.enter_context(block_plate(dim=plate.dim, strict=False))
            z_unconstrained = pyro.sample(
                f"{name}_shared_latent", self.guide.get_base_dist().mask(False)
            )
        # Differentiably transform.
        x_unconstrained = self.transform(z_unconstrained)
        if compute_density:
            log_density = self.transform.log_abs_det_jacobian(
                z_unconstrained, x_unconstrained
            )
        self.x_unconstrained = {
            site["name"]: (site, unconstrained_value)
            for site, unconstrained_value in self.guide._unpack_latent(
                x_unconstrained
            )
        }
    # Extract a single site's value from the shared latent.
    site, unconstrained_value = self.x_unconstrained.pop(name)
    transform = biject_to(fn.support)
    value = transform(unconstrained_value)
    if compute_density:
        logdet = transform.log_abs_det_jacobian(unconstrained_value, value)
        logdet = sum_rightmost(logdet, logdet.dim() - value.dim() + fn.event_dim)
        log_density = log_density + fn.log_prob(value) + logdet
    new_fn = dist.Delta(value, log_density, event_dim=fn.event_dim)
    return {"fn": new_fn, "value": value, "is_observed": True}