code: def run_precommit(fp: pathlib.Path, attempts: int = 2):
      try:
          for a in range(attempts):
              _log.info("⏳ Running pre-commit attempt %i on %s", a, fp)
              try:
                  subprocess.check_call(
                      ["pre-commit", "run", "--files", str(fp)]
                  )
                  break
              except subprocess.CalledProcessError:
                  if a == attempts - 1:
                      raise
          return True
      except Exception as ex:
          _log.exception("❌ Failed to run pre-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 2 for calling a global function with example usage: run_precommit(fp, attempts) and returns: True, False