code: def mc_dropout_bald(
      classifier: BaseEstimator,
      X: modALinput,
      n_instances: int = 1,
      random_tie_break: bool = False,
      dropout_layer_indexes: list = [],
      num_cycles: int = 50,
      sample_per_forward_pass: int = 1000,
      logits_adaptor: Callable[
          [torch.tensor, modALinput], torch.tensor
      ] = default_logits_adaptor,
      **mc_dropout_kwargs,
  ) -> np.ndarray:
      """
      Mc-Dropout bald query strategy. Returns the indexes of the instances with the largest BALD
      (Bayesian Active Learning by Disagreement) score calculated through the dropout cycles
      and the corresponding bald score.
  
      Based on the work of:
          Deep Bayesian Active Learning with Image Data.
          (Yarin Gal, Riashat Islam, and Zoubin Ghahramani. 2017.)
          Dropout as a Bayesian Approximation: Representing Model Uncer- tainty in Deep Learning.
          (Yarin Gal and Zoubin Ghahramani. 2016.)
          Bayesian Active Learning for Classification and Preference Learning.
          (NeilHoulsby,FerencHusza ́r,ZoubinGhahramani,andMa ́te ́Lengyel. 2011.)
  
      Args:
          classifier: The classifier for which the labels are to be queried.
          X: The pool of samples to query from.
          n_instances: Number of samples to be queried.
          random_tie_break: If True, shuffles utility scores to randomize the order. This
              can be used to break the tie when the highest utility score is not unique.
          dropout_layer_indexes: Indexes of the dropout layers which should be activated
              Choose indices from : list(torch_model.modules())
          num_cycles: Number of forward passes with activated dropout
          sample_per_forward_pass: max. sample number for each forward pass.
              The allocated RAM does mainly depend on this.
              Small number --> small RAM allocation
          logits_adaptor: Callable which can be used to adapt the output of a forward pass
              to the required vector format for the vectorised metric functions
          **uncertainty_measure_kwargs: Keyword arguments to be passed for the uncertainty
              measure function.
  
      Returns:
          The indices of the instances from X chosen to be labelled;
          The mc-dropout metric of the chosen instances;
      """
      predictions = get_predictions(
          classifier,
          X,
          dropout_layer_indexes,
          num_cycles,
          sample_per_forward_pass,
          logits_adaptor,
      )
      # calculate BALD (Bayesian active learning divergence))
  
      bald_scores = _bald_divergence(predictions)
  
      if not random_tie_break:
          return multi_argmax(bald_scores, n_instances=n_instances)
  
      return shuffled_argmax(bald_scores, n_instances=n_instances)
  
imports: from collections.abc import Mapping
  from typing import Callable
  import numpy
  import torch
  from scipy.special import entr
  from sklearn.base import BaseEstimator
  from skorch.utils import to_numpy
  from modAL.utils.data import modALinput
  from modAL.utils.selection import multi_argmax, shuffled_argmax
label_desc: Use image node_id 2 for calling a global function with example usage: mc_dropout_bald(classifier, X, n_instances, random_tie_break, dropout_layer_indexes, num_cycles, sample_per_forward_pass, logits_adaptor) and returns: shuffled_argmax, multi_argmax