class_docstr: Abstract class that defines a Heuristic.
  
  Args:
      shuffle_prop (float): shuffle proportion.
      reverse (bool): True if the most uncertain sample has the highest value.
      reduction (Union[str, Callable]): Reduction used after computing the score.
class_docstr_tok: ["Abstract","class","that","defines","a","Heuristic",".","Args",":","shuffle_prop","(","float",")",":","shuffle","proportion",".","reverse","(","bool",")",":","True","if","the","most","uncertain","sample","has","the","highest","value",".","reduction","(","Union","[","str",",","Callable","]",")",":","Reduction","used","after","computing","the","score","."]
docstr: Order indices given their uncertainty score.
  
  Args:
      scores (ndarray/ List[ndarray]): Array of uncertainties or
          list of arrays.
  
  Returns:
      ordered index according to the uncertainty (highest to lowes).
  
  Raises:
      ValueError if `scores` is not uni-dimensional.
docstr_tok: ["Order","indices","given","their","uncertainty","score",".","Args",":","scores","(","ndarray\/","List","[","ndarray","]",")",":","Array","of","uncertainties","or","list","of","arrays",".","Returns",":","ordered","index","according","to","the","uncertainty","(","highest","to","lowes",")",".","Raises",":","ValueError","if","`","scores","`","is","not","uni-dimensional","."]
code: def reorder_indices(self, scores):
      """
      Order indices given their uncertainty score.
  
      Args:
          scores (ndarray/ List[ndarray]): Array of uncertainties or
              list of arrays.
  
      Returns:
          ordered index according to the uncertainty (highest to lowes).
  
      Raises:
          ValueError if `scores` is not uni-dimensional.
      """
      if isinstance(scores, Sequence):
          scores = np.concatenate(scores)
  
      if scores.ndim > 1:
          raise ValueError(
              (
                  f"Can't order sequence with more than 1 dimension."
                  f"Currently {scores.ndim} dimensions."
                  f"Is the heuristic reduction method set: {self._reduction_name}"
              )
          )
      assert (
          scores.ndim == 1
      )  # We want the uncertainty value per sample.
      ranks = np.argsort(scores)
      if self.reversed:
          ranks = ranks[::-1]
      ranks = _shuffle_subset(ranks, self.shuffle_prop)
      return ranks
  
imports: import types
  import warnings
  from collections.abc import Sequence
  from functools import wraps
  from typing import List
  import numpy
  import scipy.stats
  import torch
  from scipy.special import xlogy
  from torch import Tensor
  from baal.utils.array_utils import to_prob
label_desc: Use image node_id 5 for calling the AbstractHeuristic obj's underlying member method code with example usage: obj.reorder_indices(scores) and returns: ranks