code: def test_trial_with_script():
      domain = Domain(
          {
              "--x": {0, 1, 2, 3},
              "--y": [-1.0, 1.0],
              "--z": {"123", "abc"},
          }
      )
      trial = Trial(
          objective="hypertunity/scheduling/tests/script.py",
          domain=domain,
          optimiser="random_search",
          database_path=None,
          seed=7,
          metrics=["score"],
      )
      batch_size = 4
      trial.run(n_steps=1, batch_size=batch_size, n_parallel=batch_size)
  
      rs = RandomSearch(domain=domain, seed=7)
      samples = rs.run_step(batch_size=batch_size)
      jobs = [
          Job(
              task="hypertunity/scheduling/tests/script.py",
              args=s.as_dict(),
              meta={"binary": "python"},
          )
          for s in samples
      ]
      results = [r.data for r in run_jobs(jobs)]
      assert results == [
          h.metrics["score"].value for h in trial.optimiser.history
      ]
  
file_path: hypertunity/hypertunity/tests/test_trial.py
imports: import pytest
  from hypertunity import Domain, Trial
  from hypertunity.optimisation import RandomSearch
  from hypertunity.reports import Table
  from hypertunity.scheduling import Job
  from hypertunity.scheduling.tests.test_scheduler import run_jobs
label_desc: Use image node_id 3 for calling a global function with example usage: test_trial_with_script() without return types