code: def generate_and_plot_sampels(network, nx, ny):
      space_x = np.linspace(-3, 3, nx)
      space_y = np.linspace(-3, 3, ny)
  
      plt.figure(figsize=(12, 12))
  
      grid = gridspec.GridSpec(nx, ny)
      grid.update(wspace=0, hspace=0)
  
      for i, x in enumerate(space_x):
          for j, y in enumerate(space_y):
              sample = np.array([[x, y]])
              digit = generator.predict(sample)
              image = digit[0].reshape((28, 28))
  
              plt.subplot(grid[nx * i + j])
              plt.imshow(image, cmap="Greys_r")
              plt.axis("off")
  
      plt.show()
  
file_path: neupy/examples/autoencoder/variational_autoencoder.py
imports: import numpy
  import tensorflow
  import matplotlib.pyplot
  import matplotlib.gridspec
  from sklearn import model_selection, datasets
  from neupy import algorithms
  from neupy.layers import *
  from neupy.exceptions import LayerConnectionError
label_desc: Use image node_id 2 for calling a global function with example usage: generate_and_plot_sampels(network, nx, ny) without return types