code: def test_combine_heuristics_uncertainty_generator():
      np.random.seed(1337)
      prediction_chunks = [
          chunks(distributions_3d, 2),
          chunks(distributions_5d, 2),
      ]
      predictions = [distributions_3d, distributions_5d]
  
      heuristics = CombineHeuristics(
          [BALD(), Variance()], weights=[0.5, 0.5], reduction="mean"
      )
  
      assert np.allclose(
          heuristics.get_uncertainties(predictions),
          heuristics.get_uncertainties(prediction_chunks),
      )
  
      prediction_chunks = [
          chunks(distributions_3d, 2),
          chunks(distributions_5d, 2),
      ]
      ranks = heuristics(prediction_chunks)
      assert np.all(
          ranks == [1, 2, 0]
      ), "Combine Heuristics is not right {}".format(ranks)
  
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 14 for calling a global function with example usage: test_combine_heuristics_uncertainty_generator() without return types