code: def test_tuner_generate(self):
      for algorithm in ["tpe", "random_search", "anneal"]:
          tuner = HyperoptTuner(algorithm)
          choice_list = ["a", "b", 1, 2]
          tuner.update_search_space(
              {
                  "a": {"_type": "randint", "_value": [1, 3]},
                  "b": {"_type": "choice", "_value": choice_list},
              }
          )
          for k in range(30):
              # sample multiple times
              param = tuner.generate_parameters(k)
              print(param)
              self.assertIsInstance(param["a"], int)
              self.assertGreaterEqual(param["a"], 1)
              self.assertLessEqual(param["a"], 2)
              self.assertIn(param["b"], choice_list)
  
file_path: nni/test/ut/sdk/test_hyperopt_tuner.py
imports: from unittest import TestCase, main
  import hyperopt
  from nni.algorithms.hpo.hyperopt_tuner import json2space, json2parameter, json2vals, HyperoptTuner
label_desc: Use image node_id 4 for calling the HyperoptTunerTestCase obj's underlying member method code with example usage: obj.test_tuner_generate() without return types