code: def test_slurm_from_script(shared_slurm_tmp_dir):
      domain = Domain(
          {"x": {0, 1, 2, 3}, "y": [-1.0, 1.0], "z": {"123", "abc"}},
          seed=7,
      )
      jobs, dirs = [], []
      n_jobs = 4
      for i in range(n_jobs):
          sample = domain.sample()
          dirs.append(
              tempfile.TemporaryDirectory(dir=shared_slurm_tmp_dir)
          )
          jobs.append(
              SlurmJob(
                  task="hypertunity/scheduling/tests/script.py",
                  args=(*sample.as_namedtuple(),),
                  output_file=f"{os.path.join(dirs[-1].name, 'results.pkl')}",
                  meta={"binary": "python", "resources": {"cpu": 1}},
              )
          )
      results = run_jobs(jobs)
      assert all(
          [
              r.data == script.main(*j.args)
              for r, j in zip(results, jobs)
          ]
      )
      # clean-up the temporary dirs
      for d in dirs:
          d.cleanup()
  
file_path: hypertunity/hypertunity/scheduling/tests/test_scheduler.py
imports: import os
  import tempfile
  import pytest
  from hypertunity.domain import Domain, Sample
  from hypertunity.optimisation import base
  from ..jobs import Job, SlurmJob
  from ..scheduler import Scheduler
  from .None import script
label_desc: Use image node_id 8 for calling a global function with example usage: test_slurm_from_script(shared_slurm_tmp_dir) without return types