code: def calculateEntropy(df: pd.DataFrame, config: dict) -> float:
      """
      Calculate entropy for a given dataframe with respect
          to the algorithm in the configuration
      Args:
          df (pd.DataFrame): train set's data frame
          config (dict): configuration dictionary
      Returns:
          entropy (float)
      """
      algorithm = config["algorithm"]
  
      # --------------------------
  
      if algorithm == "Regression":
          return 0
  
      logger.debug(df)
  
      instances = df.shape[0]
  
      decisions = df["Decision"].value_counts().keys().tolist()
  
      entropy = 0
      for i, decision in enumerate(decisions):
          num_of_decisions = df["Decision"].value_counts().tolist()[i]
          logger.debug(f"{decision} -> {num_of_decisions}")
          class_probability = num_of_decisions / instances
          entropy = entropy - class_probability * math.log(
              class_probability, 2
          )
  
      return entropy
  
imports: import math
  import uuid
  import json
  import copy
  import gc
  from contextlib import closing
  from typing import Optional
  import psutil
  import numpy
  import pandas
  from chefboost.training import Preprocess
  from chefboost.commons import functions
  from chefboost.commons.logger import Logger
  from chefboost.commons.module import load_module
  from chefboost.commons.daemon import CustomPool
label_desc: Use image node_id 1 for calling a global function with example usage: calculateEntropy(df, config) and returns: entropy, int