code: def evaluate_continuous_1d(opt, batch_size, n_steps, **kwargs):
      all_samples = []
      all_evaluations = []
      for i in range(n_steps):
          samples = opt.run_step(batch_size, minimise=False, **kwargs)
          evaluations = continuous_1d(
              np.array([s["x"] 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"] 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 np.isclose(best_sample, CONT_1D_ARGMAX, atol=1e-1)
      assert np.isclose(best_eval, CONT_1D_MAX, atol=1e-1)
  
file_path: hypertunity/hypertunity/optimisation/tests/_common.py
imports: import numpy
  from hypertunity.optimisation import EvaluationScore
label_desc: Use image node_id 5 for calling a global function with example usage: evaluate_continuous_1d(opt, batch_size, n_steps) without return types