code: def test_recompute_duals_upper():
      ocrl = OnlineCressieRead(alpha=0.05, tau=0.999)
  
      ws = np.random.RandomState(seed=42).exponential(size=10)
      rs = np.random.RandomState(seed=2112).random_sample(size=10)
      duals = []
      bounds = []
  
      for w, r in zip(ws, rs):
          ocrl.update(1, w, r)
          ocrl.recomputeduals(is_upper=True)
          if ocrl.duals[1][0] is None:
              duals.append((True, 0, 0, 0, 0))
          else:
              bounds.append(ocrl.duals[0][0])
              duals.append(
                  (
                      False,
                      ocrl.duals[1][0]["kappastar"],
                      ocrl.duals[1][0]["gammastar"],
                      ocrl.duals[1][0]["betastar"],
                      ocrl.n,
                  )
              )
  
      exp_bounds = [
          0.28128352388284217,
          0.5056614942571485,
          0.6220782066057806,
          0.75416164144364,
          0.8175722577850846,
          0.944281011930322,
          0.7625855039970183,
          0.7386659400005198,
          0.69289830401895,
      ]
  
      np.testing.assert_almost_equal(exp_bounds, bounds, 5)
  
imports: from distributionally_robust_data import OnlineCressieRead
  from math import exp, pi
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: test_recompute_duals_upper() without return types