code: def test_images(request):
      """A collection of test images.
  
      Note: The images are cached persistently (across test runs) in
      the project's root folder (at `project_root/.test_images`).
  
      """
      # A temporary directory loaded with the test image files
      # downloaded once in the beginning
  
      checkout_dir = request.config.cache.get(
          "imageio_test_binaries", None
      )
  
      if checkout_dir is not None and not Path(checkout_dir).exists():
          # cache value set, but cache is gone :( ... recreate
          checkout_dir = None
  
      if checkout_dir is None:
          # download test images and other binaries
          checkout_dir = Path(__file__).parents[1] / ".test_images"
  
          try:
              checkout_dir.mkdir()
          except FileExistsError:
              pass  # dir exist, validate and fail later
          else:
              with working_directory(checkout_dir):
                  repo_location = request.config.getoption(
                      "--test-images"
                  )
                  os.system(f"git clone {repo_location} .")
  
          request.config.cache.set(
              "imageio_test_binaries", str(checkout_dir)
          )
  
      checkout_dir = Path(checkout_dir)
  
      with working_directory(checkout_dir):
          result = os.system("git pull")
  
      if result != 0:
          request.config.cache.set("imageio_test_binaries", None)
          raise RuntimeError(
              "Cache directory is corrupt. Delete `.test_images` at project root."
          )
  
      return checkout_dir
  
file_path: imageio/tests/conftest.py
imports: import contextlib
  import os
  import shutil
  import sys
  import warnings
  from functools import wraps
  from pathlib import Path
  import pytest
  import imageio
label_desc: Use image node_id 4 for calling a global function with example usage: test_images(request) and returns: checkout_dir