code: def test_objective_anchor_points_with_duplicate(self):
      space = [
          {"name": "var_1", "type": "discrete", "domain": (-1, 2)},
          {"name": "var_2", "type": "discrete", "domain": (0, 1)},
          {"name": "var_3", "type": "categorical", "domain": (0, 1)},
      ]
  
      design_space = Design_space(space)
  
      np.random.seed(666)
  
      design_type = "random"
  
      dummy_objective = lambda X: np.sum(X * X, axis=1)
  
      generator = ObjectiveAnchorPointsGenerator(
          design_space, design_type, dummy_objective, num_samples=1000
      )
  
      initial_points = np.array([[-1, 1, 0], [-1, 1, 1]])
  
      duplicate_manager = DuplicateManager(design_space, initial_points)
  
      # There is a total of 2x2x2=8 possible configurations, minus the 2 defined in initial_points
      solution = np.array(
          [
              [-1.0, 0.0, 1.0, 0.0],
              [-1.0, 0.0, 0.0, 1.0],
              [2.0, 0.0, 1.0, 0.0],
              [2.0, 0.0, 0.0, 1.0],
              [2.0, 1.0, 1.0, 0.0],
              [2.0, 1.0, 0.0, 1.0],
          ]
      )
      anchor_points = generator.get(
          num_anchor=6, duplicate_manager=duplicate_manager, unique=True
      )
      self.assertTrue(np.all(anchor_points == solution))
  
      all_points = np.vstack(
          (initial_points, design_space.zip_inputs(solution))
      )
      duplicate_manager_with_all_points = DuplicateManager(
          design_space, all_points
      )
  
      # There aren't any more candidates to generate, hence the exception
      self.assertRaises(
          Exception,
          lambda: generator.get(
              num_anchor=1,
              duplicate_manager=duplicate_manager_with_all_points,
              unique=True,
          ),
      )
  
file_path: GPyOpt/GPyOpt/testing/functional_tests/test_anchor_points_generator.py
imports: import unittest
  import numpy
  from GPyOpt.core.task.space import Design_space
  from GPyOpt.util.duplicate_manager import DuplicateManager
  from GPyOpt.optimization.anchor_points_generator import ObjectiveAnchorPointsGenerator, ThompsonSamplingAnchorPointsGenerator, RandomAnchorPointsGenerator
label_desc: Use image node_id 2 for calling the TestAnchorPointsGenerator obj's underlying member method code with example usage: obj.test_objective_anchor_points_with_duplicate() without return types