code: def _entropy(proba: list) -> np.ndarray:
      """
      Calculates the entropy per class over dropout cycles
  
      As it is explicitly formulated in:
          Deep Bayesian Active Learning with Image Data.
          (Yarin Gal, Riashat Islam, and Zoubin Ghahramani. 2017.)
  
      Args:
          proba: list with the predictions over the dropout cycles
          mask: mask to detect the padded classes (must be of same shape as elements in proba)
      Return:
          Returns the entropy of the dropout cycles over all classes.
      """
  
      proba_stacked = np.stack(proba, axis=len(proba[0].shape))
  
      # calculate entropy per class and sum along dropout cycles
      entropy_classes = entropy_sum(proba_stacked, axis=-1)
      entropy = np.mean(
          entropy_classes, where=~np.isnan(entropy_classes), axis=-1
      )
      return entropy
  
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 9 for calling a global function with example usage: _entropy(proba) and returns: entropy