code: def _sample_white_noise(
      sample_inputs, int_inputs, dim, prototype, rng_key
  ):
      if [v.dtype for v in sample_inputs.values()] == ["real"]:
          # Lazily compute a sample as a function of white noise.
          k, d = next(iter(sample_inputs.items()))
          return Variable(k, d)[tuple(int_inputs)]
  
      # Eagerly draw noise.
      shape = tuple(
          d.size for d in sample_inputs.values() if d.dtype != "real"
      )
      shape += tuple(d.size for d in int_inputs.values())
      shape += (dim,)
      assert ops.is_numeric_array(prototype)
      return ops.randn(prototype, shape, rng_key)
  
imports: import math
  from collections import OrderedDict, defaultdict
  from contextlib import contextmanager
  from functools import reduce
  import funsor.ops
  from funsor.affine import affine_inputs, extract_affine, is_affine
  from funsor.delta import Delta
  from funsor.domains import Real, Reals
  from funsor.interpretations import compress_gaussians
  from funsor.ops import AddOp, SubOp
  from funsor.tensor import Tensor, align_tensor, align_tensors
  from funsor.terms import Binary, Funsor, FunsorMeta, Number, Slice, Subs, Variable, eager, reflect
  from funsor.util import broadcast_shape, get_tracing_state, lazy_property
label_desc: Use image node_id 15 for calling a global function with example usage: _sample_white_noise(sample_inputs, int_inputs, dim, prototype, rng_key) and returns: ops, Variable