code: def create_sprite(images: np.ndarray) -> np.ndarray:
      """
      Creates a sprite of provided images.
  
      :param images: Images to construct the sprite.
      :return: An image array containing the sprite.
      """
      shape = np.shape(images)
  
      if len(shape) < 3 or len(shape) > 4:
          raise ValueError(
              "Images provided for sprite have wrong dimensions "
              + str(len(shape))
          )
  
      if len(shape) == 3:
          # Check to see if it's MNIST type of images and add axis to show image is gray-scale
          images = np.expand_dims(images, axis=3)
          shape = np.shape(images)
  
      # Change black and white images to RGB
      if shape[3] == 1:
          images = convert_to_rgb(images)
  
      n = int(np.ceil(np.sqrt(images.shape[0])))
      padding = ((0, n**2 - images.shape[0]), (0, 0), (0, 0)) + (
          (0, 0),
      ) * (images.ndim - 3)
      images = np.pad(
          images, padding, mode="constant", constant_values=0
      )
  
      # Tile the individual thumbnails into an image
      images = images.reshape((n, n) + images.shape[1:]).transpose(
          (0, 2, 1, 3) + tuple(range(4, images.ndim + 1))
      )
      images = images.reshape(
          (n * images.shape[1], n * images.shape[3]) + images.shape[4:]
      )
      sprite = (images * 255).astype(np.uint8)
  
      return sprite
  
file_path: adversarial-robustness-toolbox/art/visualization.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import os.path
  from typing import List, Optional, TYPE_CHECKING
  import numpy
  from art import config
label_desc: Use image node_id 1 for calling a global function with example usage: create_sprite(images) and returns: sprite