code: def get_metadata():
      """Get metadata about the main script.
  
      The goal of this function is to capture the additional information needed
      to re-run an experiment, assuming that the launcher script that started the
      experiment is located in a clean git repository.
  
      Returns:
          tuple[str, dict[str, str]]:
            * Absolute path to root directory of launcher's git repo.
            * Directory containing:
              * githash (str): Hash of the git revision of the repo the
                  experiment was started from. "-dirty" will be appended to this
                  string if the repo has uncommitted changes. May not be present
                  if the main script is not in a git repo.
              * launcher (str): Relative path to the main script from the base of
                  the repo the experiment was started from. If the main script
                  was not started from a git repo, this will instead be an
                  absolute path to the main script.
  
      """
      main_file = getattr(main, "__file__", None)
      if not main_file:
          return None, {}
      main_file_path = os.path.abspath(main_file)
      try:
          git_root_path = subprocess.check_output(
              ("git", "rev-parse", "--show-toplevel"),
              cwd=os.path.dirname(main_file_path),
              stderr=subprocess.DEVNULL,
          )
          git_root_path = git_root_path.strip()
      except subprocess.CalledProcessError:
          # This file is always considered not to exist.
          git_root_path = ""
      # We check that the path exists since in old versions of git the above
      # rev-parse command silently exits with 0 when run outside of a git repo.
      if not os.path.exists(git_root_path):
          return None, {
              "launcher": main_file_path,
          }
      launcher_path = os.path.relpath(
          bytes(main_file_path, encoding="utf8"), git_root_path
      )
      git_hash = subprocess.check_output(
          ("git", "rev-parse", "HEAD"), cwd=git_root_path
      )
      git_hash = git_hash.decode("utf-8").strip()
      git_status = subprocess.check_output(
          ("git", "status", "--short"), cwd=git_root_path
      )
      git_status = git_status.decode("utf-8").strip()
      if git_status != "":
          git_hash = git_hash + "-dirty"
      return git_root_path, {
          "githash": git_hash,
          "launcher": launcher_path.decode("utf-8"),
      }
  
imports: import collections
  import datetime
  import enum
  import functools
  import gc
  import inspect
  import json
  import os
  import pathlib
  import subprocess
  import warnings
  import weakref
  import dateutil.tz
  import dowel
  from dowel import logger
  import numpy
  import __main__
label_desc: Use image node_id 5 for calling a global function with example usage: get_metadata() and returns: git_root_path,  dict, None,  dict, None,  dict