code: def make_batch_image_grid(dim_grid, number_grid):
      """Returns a patched `make_grid` function for grid."""
      assert dim_grid in (1, 2)
      if dim_grid == 1:
          batch_image_grid = functools.partial(
              batch_image,
              max_images=number_grid,
              rows=1,
              cols=number_grid,
          )
      else:
          batch_image_grid = functools.partial(
              batch_image,
              max_images=number_grid * number_grid,
              rows=number_grid,
              cols=number_grid,
          )
      return batch_image_grid
  
imports: import functools
  import importlib
  import os
  from magenta.models.latent_transfer import local_mnist
  import numpy
  from PIL import Image
  import tensorflow.compat.v1
label_desc: Use image node_id 11 for calling a global function with example usage: make_batch_image_grid(dim_grid, number_grid) and returns: batch_image_grid