code: def test_run_optuna(self) -> None:
      algo_dict = self.history[-1]
      algo = algo_dict[AlgoKeys.ALGO]
  
      class OptunaGenLearningRate(OptunaGen):
          def get_hyperparameters(self):
              return {
                  "learning_rate": self.trial.suggest_float(
                      "learning_rate", 0.00001, 0.1
                  )
              }
  
      optuna_gen = OptunaGenLearningRate(
          algo=algo, params=override_param
      )
      search_space = {"learning_rate": [0.0001, 0.001, 0.01, 0.1]}
      study = optuna.create_study(
          sampler=optuna.samplers.GridSampler(search_space),
          direction="maximize",
      )
      study.optimize(
          partial(
              optuna_gen,
              obj_filename=optuna_gen.get_obj_filename(),
              output_folder=os.path.join(self.test_path, "optuna_test"),
          ),
          n_trials=2,
      )
      print(
          f"Best value: {study.best_value} (params: {study.best_params})\n"
      )
  
imports: from __future__ import annotations
  import os
  import tempfile
  import unittest
  from functools import partial
  import nibabel
  import numpy
  import torch
  from monai.apps.auto3dseg import BundleGen, DataAnalyzer, NNIGen, OptunaGen, import_bundle_algo_history
  from monai.bundle.config_parser import ConfigParser
  from monai.data import create_test_image_3d
  from monai.utils import optional_import
  from monai.utils.enums import AlgoKeys
  from tests.utils import SkipIfBeforePyTorchVersion, get_testing_algo_template_path, skip_if_downloading_fails, skip_if_no_cuda
label_desc: Use image node_id 3 for calling the TestHPO obj's underlying member method code with example usage: obj.test_run_optuna() and returns: dict