code: def test_log_ei():
      for mean, var in [(0, 1), (-4, 9)]:
          thresholds = np.arange(-5, 30, 0.25) * np.sqrt(var) + mean
  
          ei = np.asarray(
              [
                  crit.EI_gaussian(mean, var, thresh)
                  for thresh in thresholds
              ]
          )
          nlei = np.asarray(
              [
                  crit.logEI_gaussian(mean, var, thresh)
                  for thresh in thresholds
              ]
          )
          naive = np.log(ei)
          # import matplotlib.pyplot as plt
          # plt.plot(thresholds, ei, label='ei')
          # plt.plot(thresholds, nlei, label='nlei')
          # plt.plot(thresholds, naive, label='naive')
          # plt.legend()
          # plt.show()
  
          # -- assert that they match when the threshold isn't too high
          assert np.allclose(nlei, naive)
  
imports: import numpy
  import hyperopt.criteria
label_desc: Use image node_id 2 for calling a global function with example usage: test_log_ei() without return types