class_docstr: Wrap a HPO tuner as a NAS strategy.
  
  Currently we only support:
  
  - Search space with choices.
  - Calling the tuner's ``generate_parameters`` method to generate new models.
  - Calling the tuner's ``receive_trial_result`` method to report the results of models.
  
  We don't support advanced features like checkpointing, resuming, or customized trials.
  
  Parameters
  ----------
  tuner
      A HPO tuner.
class_docstr_tok: ["Wrap","a","HPO","tuner","as","a","NAS","strategy",".","Currently","we","only","support",":","-","Search","space","with","choices",".","-","Calling","the","tuner","'s","``","generate_parameters","``","method","to","generate","new","models",".","-","Calling","the","tuner","'s","``","receive_trial_result","``","method","to","report","the","results","of","models",".","We","do","n't","support","advanced","features","like","checkpointing",",","resuming",",","or","customized","trials",".","Parameters","--","--","--","--","--","tuner","A","HPO","tuner","."]
code: def _run(self) -> None:
      tuner_search_space = {
          label: mutable.as_legacy_dict()
          for label, mutable in self.model_space.simplify().items()
      }
      _logger.debug("Tuner search space: %s", tuner_search_space)
  
      with self._thread_lock:
          self.tuner.update_search_space(
              cast(SearchSpace, tuner_search_space)
          )
  
      while self.engine.budget_available():
          if self.engine.idle_worker_available():
              with self._thread_lock:
                  try:
                      param = self.tuner.generate_parameters(
                          self._model_count
                      )
                  except nni.NoMoreTrialError:
                      _logger.warning(
                          "No more trial generated by tuner. Stopping."
                      )
                      break
                  _logger.debug(
                      "[%4d] Tuner generated parameters: %s",
                      self._model_count,
                      param,
                  )
                  model = self.model_space.freeze(param)
                  self._model_to_id[model] = self._model_count
                  self._model_count += 1
  
              self.engine.submit_models(model)
  
          time.sleep(1.0)
  
imports: from __future__ import annotations
  import logging
  import time
  import threading
  from typing import cast
  import nni
  from nni.nas.execution import ExecutionEngine
  from nni.nas.execution.event import FinalMetricEvent, TrainingEndEvent, ModelEventType
  from nni.nas.space import ExecutableModelSpace, ModelStatus
  from nni.tuner import Tuner
  from nni.typehint import SearchSpace
  from .base import Strategy
label_desc: Use image node_id 5 for calling the HPOTunerStrategy obj's underlying member method code with example usage: obj._run() without return types