code: def sample_multi(num_digits, canvas_size, mnist):
      canvas = np.zeros((canvas_size, canvas_size))
      labels = []
      for _ in range(num_digits):
          positioned_digit, label = sample_one(canvas_size, mnist)
          canvas += positioned_digit
          labels.append(label)
      # Crude check for overlapping digits.
      if np.max(canvas) > 255:
          return sample_multi(num_digits, canvas_size, mnist)
      else:
          return canvas, labels
  
file_path: pyro/pyro/contrib/examples/multi_mnist.py
imports: import os
  import numpy
  from PIL import Image
  from pyro.contrib.examples.util import get_data_loader
label_desc: Use image node_id 3 for calling a global function with example usage: sample_multi(num_digits, canvas_size, mnist) and returns: sample_multi, canvas,  labels