code: def test_heuristics_reorder_list():
      # we are just testing if given calculated uncertainty measures for chunks of data
      # the `reorder_indices` would make correct decision. Here index 0 has the
      # highest uncertainty chosen but both methods (uncertainties1 and uncertainties2)
      streaming_prediction = [
          np.array([0.98]),
          np.array([0.87, 0.68]),
          np.array([0.96, 0.54]),
      ]
      heuristic = BALD()
      ranks = heuristic.reorder_indices(streaming_prediction)
      assert np.all(
          ranks == [0, 3, 1, 2, 4]
      ), "reorder list for BALD is not right {}".format(ranks)
  
      heuristic = Variance()
      ranks = heuristic.reorder_indices(streaming_prediction)
      assert np.all(
          ranks == [0, 3, 1, 2, 4]
      ), "reorder list for Variance is not right {}".format(ranks)
  
      heuristic = Entropy()
      ranks = heuristic.reorder_indices(streaming_prediction)
      assert np.all(
          ranks == [0, 3, 1, 2, 4]
      ), "reorder list for Entropy is not right {}".format(ranks)
  
      heuristic = Margin()
      ranks = heuristic.reorder_indices(streaming_prediction)
      assert np.all(
          ranks == [4, 2, 1, 3, 0]
      ), "reorder list for Margin is not right {}".format(ranks)
  
      heuristic = Certainty()
      ranks = heuristic.reorder_indices(streaming_prediction)
      assert np.all(
          ranks == [4, 2, 1, 3, 0]
      ), "reorder list for Certainty is not right {}".format(ranks)
  
      heuristic = Random()
      ranks = heuristic.reorder_indices(streaming_prediction)
      assert (
          ranks.size == 5
      ), "reorder list for Random 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 15 for calling a global function with example usage: test_heuristics_reorder_list() without return types