code: def evaluate_discrete_3d(opt, batch_size, n_steps):
      all_samples = []
      all_evaluations = []
      for i in range(n_steps):
          samples = opt.run_step(batch_size, minimise=False)
          evaluations = [
              discrete_3d(s["x"], s["y"], s["z"]) for s in samples
          ]
          opt.update(
              samples,
              [EvaluationScore(ev) for ev in evaluations],
          )
          # gather the samples and evaluations for later assessment
          all_samples.extend(
              [(s["x"], s["y"], s["z"]) for s in samples]
          )
          all_evaluations.extend(evaluations)
      best_eval_index = int(np.argmax(all_evaluations))
      best_sample = all_samples[best_eval_index]
      best_eval = all_evaluations[best_eval_index]
      assert best_sample == DISCRETE_3D_ARGMAX
      assert best_eval == DISCRETE_3D_MAX
  
file_path: hypertunity/hypertunity/optimisation/tests/_common.py
imports: import numpy
  from hypertunity.optimisation import EvaluationScore
label_desc: Use image node_id 7 for calling a global function with example usage: evaluate_discrete_3d(opt, batch_size, n_steps) without return types