class_docstr: Tests for the algo Hyperband.
class_docstr_tok: ["Tests","for","the","algo","Hyperband","."]
docstr: Test that same trials are not allowed in different suggest call of
  the same hyperband execution.
docstr_tok: ["Test","that","same","trials","are","not","allowed","in","different","suggest","call","of","the","same","hyperband","execution","."]
code: def test_suggest_duplicates_between_calls(
      self, monkeypatch, hyperband: Hyperband, bracket: HyperbandBracket
  ):
      """Test that same trials are not allowed in different suggest call of
      the same hyperband execution.
      """
      hyperband.brackets = [bracket]
      assert bracket.owner is hyperband
  
      fidelity = 1
  
      duplicate_trial = create_trial_for_hb((fidelity, 0.0))
      new_trial = create_trial_for_hb((fidelity, 0.5))
  
      duplicate_id = hyperband.get_id(
          duplicate_trial, ignore_fidelity=True
      )
      bracket.rungs[0]["results"] = {duplicate_id: (0.0, duplicate_trial)}  # type: ignore
  
      hyperband.trial_to_brackets[duplicate_id] = 0
  
      trials = [duplicate_trial, new_trial]
  
      mock_samples(
          hyperband,
          trials
          + [create_trial_for_hb((fidelity, i)) for i in range(10 - 2)],
      )
      trials = hyperband.suggest(100)
      assert trials is not None
      assert trials[0].params == new_trial.params
  
imports: from __future__ import annotations
  import copy
  import logging
  import typing
  from typing import Any, ClassVar, Sequence
  import numpy
  import pytest
  from orion.algo.hyperband import BudgetTuple, Hyperband, HyperbandBracket, RungDict, compute_budgets
  from orion.algo.space import Fidelity, Integer, Real, Space
  from orion.core.utils.flatten import flatten
  from orion.core.worker.primary_algo import SpaceTransform
  from orion.core.worker.trial import Trial
  from orion.testing.algo import BaseAlgoTests, TestPhase
  from orion.testing.trial import compare_trials, create_trial
label_desc: Use image node_id 8 for calling the TestHyperband obj's underlying member method code with example usage: obj.test_suggest_duplicates_between_calls(monkeypatch, hyperband, bracket) without return types