code: def test_bald(distributions, reduction):
      np.random.seed(1338)
  
      bald = BALD(reduction=reduction)
      marg = bald(distributions)
      str_marg = bald(chunks(distributions, 2))
  
      assert np.allclose(
          bald.get_uncertainties(distributions),
          bald.get_uncertainties_generator(chunks(distributions, 2)),
      )
  
      assert np.all(marg == [1, 2, 0]), "BALD is not right {}".format(
          marg
      )
      assert np.all(
          str_marg == [1, 2, 0]
      ), "StreamingBALD is not right {}".format(marg)
  
      bald = BALD(0.99, reduction=reduction)
      marg = bald(distributions)
  
      # Unlikely, but not 100% sure
      assert np.any(marg != [1, 2, 0])
  
imports: import warnings
  import numpy
  import pytest
  from hypothesis import given
  from torch_hypothesis import class_logits
  from baal.active import get_heuristic
  from baal.active.heuristics import Random, BALD, Margin, Entropy, Certainty, Variance, BatchBALD, AbstractHeuristic, requireprobs, Precomputed, CombineHeuristics
  from tests.test_utils import make_fake_dist, make_3d_fake_dist, make_5d_fake_dist
label_desc: Use image node_id 2 for calling a global function with example usage: test_bald(distributions, reduction) without return types