code: def run_deptry(reqs, rule_ignores, path, extra_args=""):
      """Run a dependency check with deptry. Return a list of error messages"""
  
      errors = []
      try:
          result = subprocess.run(
              f'deptry -o deptry.json --no-ansi --known-first-party mindsdb --requirements-txt "{reqs}" --per-rule-ignores "{rule_ignores}" --package-module-name-map "{get_ignores_str(PACKAGE_NAME_MAP)}" {extra_args} {path}',
              shell=True,
              stdout=subprocess.DEVNULL,
              stderr=subprocess.PIPE,
          )
          if result.returncode != 0 and not os.path.exists(
              "deptry.json"
          ):
              # There was some issue with running deptry
              errors.append(
                  f"Error running deptry: {result.stderr.decode('utf-8')}"
              )
  
          with open("deptry.json", "r") as f:
              deptry_results = json.loads(f.read())
          for r in deptry_results:
              errors.append(
                  f"{r['location']['line']}:{r['location']['column']}: {r['error']['code']} {r['error']['message']}"
              )
      finally:
          if os.path.exists("deptry.json"):
              os.remove("deptry.json")
      return errors
  
file_path: mindsdb/tests/scripts/check_requirements.py
imports: import glob
  import re
  import sys
  import subprocess
  import os
  import json
label_desc: Use image node_id 4 for calling a global function with example usage: run_deptry(reqs, rule_ignores, path, extra_args) and returns: errors