code: def setup(app):
      """Install the plugin.
      Parameters
      ----------
      app: Sphinx application context.
      """
      logger.info("Initializing Examples folder revamp plugin...")
  
      app.connect("builder-inited", prepare_gallery)
      # app.connect('build-finished', summarize_failing_examples)
  
      metadata = {
          "parallel_read_safe": True,
          "version": app.config.version,
      }
  
      return metadata
  
file_path: dipy/doc/sphinxext/prepare_gallery.py
imports: import fnmatch
  import sys
  import os
  import shutil
  from os.path import join
  from dataclasses import dataclass, field
  from pathlib import Path
  from sphinx.util import logging
label_desc: Use image node_id 6 for calling a global function with example usage: setup(app) and returns: metadata