code: def test_simple_hpo():
      def f(args):
          x = args["x"]
          return x * x
  
      s = {
          "x": {
              "dist": st.uniform(loc=-10.0, scale=20),
              "lo": -10.0,
              "hi": 10.0,
          }
      }
      trials = []
  
      # Test fmin and ability to continue adding to trials
      best = fmin(loss_fn=f, space=s, max_evals=40, trials=trials)
      best = fmin(loss_fn=f, space=s, max_evals=10, trials=trials)
  
      assert len(trials) == 50, "HPO continuation trials not working"
  
      # Test verbose flag
      best = fmin(loss_fn=f, space=s, max_evals=10, trials=trials)
  
      yarray = np.array([tr["loss"] for tr in trials])
      np.testing.assert_array_less(yarray, 100.0)
  
      xarray = np.array([tr["x"] for tr in trials])
      np.testing.assert_array_less(np.abs(xarray), 10.0)
  
      assert best["loss"] < 100.0, "HPO out of range"
      assert np.abs(best["x"]) < 10.0, "HPO out of range"
  
      # Test unknown distributions
      s2 = {"x": {"dist": "normal", "mu": 0.0, "sigma": 1.0}}
      trials2 = []
      with pytest.raises(ValueError) as excinfo:
          fmin(loss_fn=f, space=s2, max_evals=40, trials=trials2)
      assert "Unknown distribution type for variable" in str(
          excinfo.value
      )
  
      s3 = {"x": {"dist": st.norm(loc=0.0, scale=1.0)}}
      trials3 = []
      fmin(loss_fn=f, space=s3, max_evals=40, trials=trials3)
  
imports: import pytest
  import numpy
  import scipy.stats
  from brainiak.hyperparamopt.hpo import gmm_1d_distribution, fmin
label_desc: Use image node_id 3 for calling a global function with example usage: test_simple_hpo() and returns: unknown