class_docstr: Tests for the algo Hyperband.
class_docstr_tok: ["Tests","for","the","algo","Hyperband","."]
docstr: Test that same points are not allowed in the same suggest call ofxs
  the same hyperband execution.
docstr_tok: ["Test","that","same","points","are","not","allowed","in","the","same","suggest","call","ofxs","the","same","hyperband","execution","."]
code: def test_suggest_duplicates_one_call(
      self, monkeypatch, hyperband: Hyperband, bracket: HyperbandBracket
  ):
      """Test that same points are not allowed in the same suggest call ofxs
      the same hyperband execution.
      """
      hyperband.brackets = [bracket]
      assert bracket.owner is hyperband
  
      zhe_point = list(
          map(
              create_trial_for_hb,
              [(1, 0.0), (1, 1.0), (1, 1.0), (1, 2.0)],
          )
      )
  
      mock_samples(hyperband, zhe_point * 2)
      zhe_samples = hyperband.suggest(100)
      assert zhe_samples is not None
      assert zhe_samples[0].params["lr"] == 0.0
      assert zhe_samples[1].params["lr"] == 1.0
      assert zhe_samples[2].params["lr"] == 2.0
  
      # zhe_point =
      mock_samples(
          hyperband,
          list(
              map(
                  create_trial_for_hb,
                  [
                      (3, 0.0),
                      (3, 1.0),
                      (3, 1.0),
                      (3, 2.0),
                      (3, 5.0),
                      (3, 4.0),
                  ],
              )
          ),
      )
      hyperband.trial_to_brackets[
          hyperband.get_id(
              create_trial_for_hb((1, 0.0)), ignore_fidelity=True
          )
      ] = 0
      hyperband.trial_to_brackets[
          hyperband.get_id(
              create_trial_for_hb((1, 0.0)), ignore_fidelity=True
          )
      ] = 0
      zhe_samples = hyperband.suggest(100)
      assert zhe_samples is not None
      assert zhe_samples[0].params["lr"] == 5.0
      assert zhe_samples[1].params["lr"] == 4.0
  
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 9 for calling the TestHyperband obj's underlying member method code with example usage: obj.test_suggest_duplicates_one_call(monkeypatch, hyperband, bracket) without return types