code: def get_atkinson_index(
      benefits: np.array,
      epsilon: float = 1.0,
      error_tolerance: float = 1e-12,
  ) -> float:
      """
      Returns the Atkinson Index, a measure of income inequality that
      indicates the percentage of the data that needs to be foregone
      to have equal shares of income.
      https://en.wikipedia.org/wiki/Atkinson_index
  
      :param benefits: The probabilities of each feature value combination
          occurring in the data.
      :type benefits: np.array
      :param epsilon: A parameter that regulates the weight given
          to the distances between benefits.
      :type epsilon: float
      :param error_tolerance: The error tolerance to use when calculating
          the Atkinson Index.
      :type error_tolerance: float
      :return: The Atkinson Index.
      :rtype: float
      """
      count = benefits.size
      benefits_mean = np.mean(benefits)
      norm_benefits = benefits / benefits_mean
      alpha = 1 - epsilon
  
      if abs(alpha) < error_tolerance:
          ati = 1.0 - np.power(np.prod(norm_benefits), 1.0 / count)
      else:
          power_mean = np.sum(np.power(norm_benefits, alpha)) / count
          ati = 1.0 - np.power(power_mean, 1.0 / alpha)
  
      return ati
  
file_path: responsible-ai-toolbox/responsibleai/responsibleai/databalanceanalysis/aggregate_balance_measures.py
imports: from typing import Callable, Dict, List
  import numpy
  import pandas
  from responsibleai.databalanceanalysis.balance_measures import BalanceMeasures
  from responsibleai.databalanceanalysis.constants import Measures
label_desc: Use image node_id 2 for calling a global function with example usage: get_atkinson_index(benefits, epsilon, error_tolerance) and returns: ati