code: def test_distributions():
      # test that the distributions come out right
  
      # XXX: test more distributions
      space = {
          "loss": (
              hp_loguniform("lu", -2, 2)
              + hp_qloguniform("qlu", np.log(1 + 0.01), np.log(20), 2)
              + hp_quniform("qu", -4.999, 5, 1)
              + hp_uniform("u", 0, 10)
          ),
          "status": "ok",
      }
      trials = base.Trials()
      N = 1000
      fmin(
          lambda x: x,
          space=space,
          algo=rand.suggest,
          trials=trials,
          max_evals=N,
          rstate=np.random.default_rng(124),
          catch_eval_exceptions=False,
      )
      assert len(trials) == N
      idxs, vals = base.miscs_to_idxs_vals(trials.miscs)
      print(list(idxs.keys()))
  
      COUNTMAX = 130
      COUNTMIN = 70
  
      # -- loguniform
      log_lu = np.log(vals["lu"])
      assert len(log_lu) == N
      assert -2 < np.min(log_lu)
      assert np.max(log_lu) < 2
      h = np.histogram(log_lu)[0]
      print(h)
      assert np.all(COUNTMIN < h)
      assert np.all(h < COUNTMAX)
  
      # -- quantized log uniform
      qlu = vals["qlu"]
      assert np.all(np.fmod(qlu, 2) == 0)
      assert np.min(qlu) == 2
      assert np.max(qlu) == 20
      bc_qlu = np.bincount(qlu)
      assert bc_qlu[2] > bc_qlu[4] > bc_qlu[6] > bc_qlu[8]
  
      # -- quantized uniform
      qu = vals["qu"]
      assert np.min(qu) == -5
      assert np.max(qu) == 5
      assert np.all(np.fmod(qu, 1) == 0)
      bc_qu = np.bincount(np.asarray(qu).astype("int") + 5)
      assert np.all(
          40 < bc_qu
      ), bc_qu  # XXX: how to get the distribution flat
      # with new rounding rule?
      assert np.all(bc_qu < 125), bc_qu
      assert np.all(bc_qu < COUNTMAX)
  
      # -- uniform
      u = vals["u"]
      assert np.min(u) > 0
      assert np.max(u) < 10
      h = np.histogram(u)[0]
      print(h)
      assert np.all(COUNTMIN < h)
      assert np.all(h < COUNTMAX)
  
file_path: hyperopt/hyperopt/tests/unit/test_vectorize.py
imports: import numpy
  from hyperopt.pyll import as_apply, scope, rec_eval, clone, dfs
  from hyperopt.pyll.stochastic import recursive_set_rng_kwarg
  from hyperopt import base, fmin, rand
  from hyperopt.vectorize import VectorizeHelper
  from hyperopt.vectorize import replace_repeat_stochastic
  from hyperopt.pyll_utils import hp_choice
  from hyperopt.pyll_utils import hp_uniform
  from hyperopt.pyll_utils import hp_quniform
  from hyperopt.pyll_utils import hp_loguniform
  from hyperopt.pyll_utils import hp_qloguniform
label_desc: Use image node_id 7 for calling a global function with example usage: test_distributions() without return types