code: def gauss_wave2():
      """
      Variant of the GaussWave problem in which noise is added to the score
      function, and there is an option to either have no sinusoidal variation, or
      a negative cosine with variable amplitude.
  
      Immediate local max is to sample x from spec and turn off the neg cos.
      Better solution is to move x a bit to the side, turn on the neg cos and turn
      up the amp to 1.
      """
  
      rng = np.random.default_rng(123)
      var = 0.1
      x = hp.uniform("x", -20, 20)
      amp = hp.uniform("amp", 0, 1)
      t = scope.normal(0, var, rng=rng) + 2 * scope.exp(-((x / 5) ** 2))
      return {
          "loss": -hp.choice("hf", [t, t + scope.sin(x) * amp]),
          "loss_variance": var,
          "status": base.STATUS_OK,
      }
  
imports: import unittest
  import numpy
  from hyperopt import Trials, Domain, fmin, hp, base
  from hyperopt.rand import suggest
  from hyperopt.pyll import as_apply
  from hyperopt.pyll import scope
label_desc: Use image node_id 9 for calling a global function with example usage: gauss_wave2() and returns: dict