code: def run_all(
      ok_tests, ok_contexts, ok_graphs, debug, num_parallel, inherit_env
  ):
      tests = [
          test
          for test in sorted(iter_tests(), key=lambda x: x.PRIORITY)
          if not ok_tests or test.__class__.__name__.lower() in ok_tests
      ]
      failed = []
  
      if inherit_env:
          base_env = dict(os.environ)
      else:
          base_env = {}
  
      if debug or num_parallel is None:
          for test in tests:
              failed.extend(
                  run_test_cases(
                      (test, ok_contexts, ok_graphs, debug, base_env)
                  )
              )
      else:
          args = [
              (test, ok_contexts, ok_graphs, debug, base_env)
              for test in tests
          ]
          for fail in Pool(num_parallel).imap_unordered(
              run_test_cases, args
          ):
              failed.extend(fail)
      return failed
  
imports: import sys
  import os
  import json
  import uuid
  import glob
  import importlib
  import tempfile
  import shutil
  import subprocess
  from multiprocessing import Pool
  from metaflow._vendor import click
  from metaflow_test import MetaflowTest
  from metaflow_test.formatter import FlowFormatter
label_desc: Use image node_id 5 for calling a global function with example usage: run_all(ok_tests, ok_contexts, ok_graphs, debug, num_parallel, inherit_env) and returns: failed