class_docstr: Used to display a list of images as a gallery that can be scrolled through.
  Preprocessing: this component does *not* accept input.
  Postprocessing: expects a list of images in any format, {List[numpy.array | PIL.Image | str | pathlib.Path]}, or a {List} of (image, {str} caption) tuples and displays them.
  
  Demos: fake_gan
docstr: Parameters:
      value: list of images, or list of (image, caption) tuples
  Returns:
      list of string file paths to images in temp directory
docstr_tok: ["Parameters",":","value",":","list","of","images",",","or","list","of","(","image",",","caption",")","tuples","Returns",":","list","of","string","file","paths","to","images","in","temp","directory"]
code: def postprocess(
      self,
      value: list[GalleryImageType | CaptionedGalleryImageType] | None,
  ) -> GalleryData:
      """
      Parameters:
          value: list of images, or list of (image, caption) tuples
      Returns:
          list of string file paths to images in temp directory
      """
      if value is None:
          return GalleryData(root=[])
      output = []
      for img in value:
          url = None
          caption = None
          orig_name = None
          if isinstance(img, (tuple, list)):
              img, caption = img
          if isinstance(img, np.ndarray):
              file = processing_utils.save_img_array_to_cache(
                  img, cache_dir=self.GRADIO_CACHE
              )
              file_path = str(utils.abspath(file))
          elif isinstance(img, _Image.Image):
              file = processing_utils.save_pil_to_cache(
                  img, cache_dir=self.GRADIO_CACHE
              )
              file_path = str(utils.abspath(file))
          elif isinstance(img, str):
              file_path = img
              if is_http_url_like(img):
                  url = img
                  orig_name = Path(urlparse(img).path).name
              else:
                  url = None
                  orig_name = Path(img).name
          elif isinstance(img, Path):
              file_path = str(img)
              orig_name = img.name
          else:
              raise ValueError(
                  f"Cannot process type as image: {type(img)}"
              )
          entry = GalleryImage(
              image=FileData(
                  path=file_path, url=url, orig_name=orig_name
              ),
              caption=caption,
          )
          output.append(entry)
      return GalleryData(root=output)
  
imports: from __future__ import annotations
  from pathlib import Path
  from typing import Any, Callable, List, Literal, Optional, Tuple, Union
  from urllib.parse import urlparse
  import numpy
  from gradio_client.documentation import document, set_documentation_group
  from gradio_client.utils import is_http_url_like
  from PIL import Image
  from gradio import processing_utils, utils
  from gradio.components.base import Component
  from gradio.data_classes import FileData, GradioModel, GradioRootModel
  from gradio.events import Events
label_desc: Use image node_id 2 for calling the Gallery obj's underlying member method code with example usage: obj.postprocess(value) and returns: GalleryData, GalleryData