code: def apply_replacements(fp: pathlib.Path) -> bool:
      try:
          _log.info("⏳ Running API migration")
          with open(fp, "r", encoding="utf-8") as file:
              lines = file.read()
  
          for pattern, substitute in REPLACEMENTS.items():
              lines = lines.replace(pattern, substitute)
  
          with open(fp, "w", encoding="utf-8") as file:
              file.write(lines)
          return True
      except Exception as ex:
          _log.exception("❌ Failed to apply replacements.", 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 1 for calling a global function with example usage: apply_replacements(fp) and returns: True, False