class_docstr: Combine heuristics for multi-output models.
  heuristics would be applied on output predictions in the assigned order.
  For each heuristic the necessary `reduction`, `reversed`
  parameters should be defined.
  
  NOTE: heuristics could be combined together only if they use the same
  value for `reversed` parameter.
  
  NOTE: `shuffle_prop` should only be defined as direct input of
  `CombineHeuristics`, otherwise there will be no effect.
  
  NOTE: `reduction` is defined for each of the input heuristics and as a direct
  input to `CombineHeuristics`. For each heuristic, `reduction` should be defined
  if the relevant model output to that heuristic has more than 3-dimenstions.
  In `CombineHeuristics`, the `reduction` is used to aggregate the final result of
  heuristics.
  
  Args:
      heuristics (list[AbstractHeuristic]): list of heuristic instances
      weights (list[float]): the assigned weights to the result of each heuristic
          before calculation of ranks
      reduction (Union[str, callable]): function that aggregates the results of the heuristics
          (default: weighted average which could be used as (reduction='mean`)
     shuffle_prop (float): shuffle proportion.
class_docstr_tok: ["Combine","heuristics","for","multi-output","models",".","heuristics","would","be","applied","on","output","predictions","in","the","assigned","order",".","For","each","heuristic","the","necessary","`","reduction","`",",","`","reversed","`","parameters","should","be","defined",".","NOTE",":","heuristics","could","be","combined","together","only","if","they","use","the","same","value","for","`","reversed","`","parameter",".","NOTE",":","`","shuffle_prop","`","should","only","be","defined","as","direct","input","of","`","CombineHeuristics","`",",","otherwise","there","will","be","no","effect",".","NOTE",":","`","reduction","`","is","defined","for","each","of","the","input","heuristics","and","as","a","direct","input","to","`","CombineHeuristics","`",".","For","each","heuristic",",","`","reduction","`","should","be","defined","if","the","relevant","model","output","to","that","heuristic","has","more","than","3-dimenstions",".","In","`","CombineHeuristics","`",",","the","`","reduction","`","is","used","to","aggregate","the","final","result","of","heuristics",".","Args",":","heuristics","(","list","[","AbstractHeuristic","]",")",":","list","of","heuristic","instances","weights","(","list","[","float","]",")",":","the","assigned","weights","to","the","result","of","each","heuristic","before","calculation","of","ranks","reduction","(","Union","[","str",",","callable","]",")",":","function","that","aggregates","the","results","of","the","heuristics","(","default",":","weighted","average","which","could","be","used","as","(","reduction='mean","`",")","shuffle_prop","(","float",")",":","shuffle","proportion","."]
docstr: Order the indices based on the given scores.
  
  Args:
      scores_list (list(ndarray)/list(list(ndarray)):
  
  Returns:
      ordered index according to the uncertainty (highest to lowes).
docstr_tok: ["Order","the","indices","based","on","the","given","scores",".","Args",":","scores_list","(","list","(","ndarray",")","\/list","(","list","(","ndarray",")",")",":","Returns",":","ordered","index","according","to","the","uncertainty","(","highest","to","lowes",")","."]
code: def reorder_indices(self, scores_list):
      """
      Order the indices based on the given scores.
  
      Args:
          scores_list (list(ndarray)/list(list(ndarray)):
  
      Returns:
          ordered index according to the uncertainty (highest to lowes).
  
      """
      if isinstance(scores_list[0], Sequence):
          scores_list = list(zip(*scores_list))
          scores_list = [np.concatenate(item) for item in scores_list]
  
      # normalizing weights
      w = np.array(self.weights).sum()
      self.weights = [weight / w for weight in self.weights]
  
      # num_heuristics X batch_size
      scores_array = np.vstack(
          [
              weight * scores
              for weight, scores in zip(self.weights, scores_list)
          ]
      )
  
      # batch_size X num_heuristic
      final_scores = self.reduction(np.swapaxes(scores_array, 0, -1))
  
      assert final_scores.ndim == 1
      ranks = np.argsort(final_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 3 for calling the CombineHeuristics obj's underlying member method code with example usage: obj.reorder_indices(scores_list) and returns: ranks