code: def test_simple_runscript(
      tmpdir, task_name, train_examples_cap, model_type
  ):
      RUN_NAME = (
          f"{test_simple_runscript.__name__}_{task_name}_{model_type}"
      )
      data_dir = str(tmpdir.mkdir("data"))
      exp_dir = str(tmpdir.mkdir("exp"))
  
      torch.use_deterministic_algorithms(True)
  
      downloader.download_data([task_name], data_dir)
      args = run.RunConfiguration(
          run_name=RUN_NAME,
          exp_dir=exp_dir,
          data_dir=data_dir,
          hf_pretrained_model_name_or_path=model_type,
          tasks=task_name,
          train_examples_cap=train_examples_cap,
          train_batch_size=32,
          seed=42,
          no_cuda=False,
      )
      run.run_simple(args)
  
      val_metrics = py_io.read_json(
          os.path.join(exp_dir, "runs", RUN_NAME, "val_metrics.json")
      )
      assert (
          math.isclose(
              val_metrics["aggregated"],
              EXPECTED_AGG_VAL_METRICS[model_type][task_name],
          )
          or val_metrics["aggregated"]
          >= EXPECTED_AGG_VAL_METRICS[model_type][task_name]
      )
      torch.use_deterministic_algorithms(False)
  
file_path: jiant/tests/proj/simple/test_runscript.py
imports: import os
  import pytest
  import torch
  import math
  import jiant.utils.python.io
  from jiant.proj.simple import runscript
  import jiant.scripts.download_data.runscript
  import jiant.utils.torch_utils
label_desc: Use image node_id 2 for calling a global function with example usage: test_simple_runscript(tmpdir, task_name, train_examples_cap, model_type) without return types