code: def run_test_cases(args):
      test, ok_contexts, ok_graphs, debug, base_env = args
      contexts = json.load(open("contexts.json"))
      graphs = list(iter_graphs())
      test_name = test.__class__.__name__
      log("Loaded test %s" % test_name)
      failed = []
  
      for graph in graphs:
          if ok_graphs and graph["name"].lower() not in ok_graphs:
              continue
  
          formatter = FlowFormatter(graph, test)
          if formatter.valid:
              for context in contexts["contexts"]:
                  if context.get("disable_parallel", False) and any(
                      "num_parallel" in node
                      for node in graph["graph"].values()
                  ):
                      continue
                  if ok_contexts:
                      if context["name"].lower() not in ok_contexts:
                          continue
                  elif context.get("disabled", False):
                      continue
                  if test_name in map(
                      str, context.get("disabled_tests", [])
                  ):
                      continue
  
                  enabled_tests = context.get("enabled_tests", [])
                  if enabled_tests and (
                      test_name not in map(str, enabled_tests)
                  ):
                      continue
  
                  log("running", formatter, context)
                  ret, path = run_test(
                      formatter,
                      context,
                      debug,
                      contexts["checks"],
                      base_env,
                  )
  
                  if ret:
                      tstid = "%s in context %s" % (
                          formatter,
                          context["name"],
                      )
                      failed.append((tstid, path))
                      log("failed", formatter, context, real_bad=True)
                      if debug:
                          return failed
                  else:
                      log("success", formatter, context, real_good=True)
          else:
              log("not a valid combination. Skipped.", formatter)
      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 6 for calling a global function with example usage: run_test_cases(args) and returns: failed, failed