code: def tf_batch_image(b, mb=36):
      """Turn a batch of images into a single image mosaic."""
      b_shape = b.get_shape().as_list()
      rows = int(np.ceil(np.sqrt(mb)))
      cols = rows
      diff = rows * cols - mb
      b = tf.concat(
          [
              b[:mb],
              tf.zeros([diff, b_shape[1], b_shape[2], b_shape[3]]),
          ],
          axis=0,
      )
      tmp = tf.reshape(
          b, [-1, cols * b_shape[1], b_shape[2], b_shape[3]]
      )
      img = tf.concat([tmp[i : i + 1] for i in range(rows)], axis=2)
      return img
  
imports: import numpy
  import sonnet
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling a global function with example usage: tf_batch_image(b, mb) and returns: img