code: def run_loop(args: RunConfiguration):
      quick_init_out = initialization.quick_init(
          args=args, verbose=True
      )
      with quick_init_out.log_writer.log_context():
          if args.jiant_task_container_path:
              jiant_task_container = (
                  container_setup.create_jiant_task_container(
                      **py_io.read_json(args.jiant_task_container_path)
                  )
              )
          else:
              raise RuntimeError(
                  "Need `jiant_task_container_path` or individual config paths"
              )
          runner = setup_runner(
              args=args,
              jiant_task_container=jiant_task_container,
              quick_init_out=quick_init_out,
              verbose=True,
          )
      supertask, output_dir = args.supertask, args.output_dir
      if supertask in ["xnli", "pawsx"]:
          generate_and_write_preds_for_classification(
              runner=runner,
              supertask=supertask,
              output_dir=output_dir,
              skip_if_done=args.skip_if_done,
          )
      elif supertask in ["udpos", "panx"]:
          generate_and_write_preds_for_tagging(
              runner=runner,
              supertask=supertask,
              output_dir=output_dir,
              skip_if_done=args.skip_if_done,
          )
      elif supertask in ["xquad", "mlqa"]:
          generate_and_write_preds_for_qa(
              runner=runner,
              supertask=supertask,
              output_dir=output_dir,
              phase="test",
              skip_if_done=args.skip_if_done,
          )
      elif supertask == "tydiqa":
          generate_and_write_preds_for_qa(
              runner=runner,
              supertask="tydiqa",
              output_dir=output_dir,
              phase="val",
              skip_if_done=args.skip_if_done,
          )
      elif supertask == "bucc2018":
          generate_and_write_preds_for_bucc2018(
              runner=runner,
              output_dir=output_dir,
              bucc_val_metrics_path=args.bucc_val_metrics_path,
              skip_if_done=args.skip_if_done,
          )
      elif supertask == "tatoeba":
          generate_and_write_preds_for_tatoeba(
              runner=runner,
              output_dir=output_dir,
              skip_if_done=args.skip_if_done,
          )
      else:
          raise KeyError(supertask)
  
imports: import os
  import numpy
  import torch
  import zconf
  import jiant.utils.python.io
  from jiant.utils.display import maybe_tqdm
  import jiant.shared.initialization
  import jiant.shared.model_resolution
  import jiant.proj.main.components.container_setup
  import jiant.proj.main.runner
  from jiant.proj.main.runscript import setup_runner
  import jiant.tasks.lib.templates.squad_style.core
  import jiant.tasks.lib.bucc2018
  import jiant.tasks
  import jiant.proj.main.components.evaluate
  from jiant.proj.main.modeling.primary import wrap_jiant_forward
label_desc: Use image node_id 1 for calling a global function with example usage: run_loop(args) without return types