code: def commit(fp: pathlib.Path, branch: str) -> bool:
      try:
          _log.info("Switching to branch %s", branch)
          if branch not in subprocess.check_output(
              ["git", "branch"]
          ).decode("ascii"):
              subprocess.check_call(["git", "checkout", "-b", branch])
          else:
              subprocess.check_call(["git", "checkout", branch])
  
          _log.info("⏳ Committing changes in %s to %s", fp, branch)
          subprocess.check_call(["git", "stage", str(fp)])
          subprocess.check_call(
              ["git", "commit", "-m", f"Re-run {fp.name} notebook"]
          )
          _log.info(
              "✔ Changes in %s were committed to branch %s.", fp, branch
          )
          return True
      except subprocess.CalledProcessError as ex:
          _log.exception("❌ Failed to commit.", exc_info=ex)
          return False
  
file_path: pymc-examples/scripts/rerun.py
imports: import argparse
  import logging
  import pathlib
  import subprocess
label_desc: Use image node_id 4 for calling a global function with example usage: commit(fp, branch) and returns: True, False