code: def get_next_parameter() -> Parameters:
      """
      Get the hyperparameters generated by tuner.
  
      Each trial should and should only invoke this function once.
      Otherwise the behavior is undefined.
  
      Examples
      --------
      Assuming the :doc:`search space </hpo/search_space>` is:
  
      .. code-block::
  
          {
              'activation': {'_type': 'choice', '_value': ['relu', 'tanh', 'sigmoid']},
              'learning_rate': {'_type': 'loguniform', '_value': [0.0001, 0.1]}
          }
  
      Then this function might return:
  
      .. code-block::
  
          {
              'activation': 'relu',
              'learning_rate': 0.02
          }
  
      Returns
      -------
      :class:`~nni.typehint.Parameters`
          A hyperparameter set sampled from search space.
      """
      global _params
      _params = get_default_trial_command_channel().receive_parameter()
      if _params is None:
          return None  # type: ignore
      return _params["parameters"]
  
file_path: nni/nni/trial.py
imports: from __future__ import annotations
  from typing import Any, cast
  from .runtime.env_vars import trial_env_vars
  from .runtime.trial_command_channel import get_default_trial_command_channel
  from .typehint import Parameters, TrialMetric, ParameterRecord
label_desc: Use image node_id 1 for calling a global function with example usage: get_next_parameter() and returns: _params, None