code: def hypervolume_contrib(front, **kargs):
      """Returns the hypervolume contribution of each individual. The provided
      *front* should be a set of non-dominated individuals having each a
      :attr:`fitness` attribute.
      """
      # Must use wvalues * -1 since hypervolume use implicit minimization
      # And minimization in deap use max on -obj
      wobj = numpy.array([ind.fitness.wvalues for ind in front]) * -1
      ref = kargs.get("ref", None)
      if ref is None:
          ref = numpy.max(wobj, axis=0) + 1
  
      total_hv = hv.hypervolume(wobj, ref)
  
      def contribution(i):
          # The contribution of point p_i in point set P
          # is the hypervolume of P without p_i
          return total_hv - hv.hypervolume(
              numpy.concatenate((wobj[:i], wobj[i + 1 :])), ref
          )
  
      # Parallelization note: Cannot pickle local function
      return map(contribution, range(len(front)))
  
file_path: deap/examples/ga/mo_rhv.py
imports: import array
  import random
  import json
  import numpy
  from math import sqrt
  from deap import algorithms
  from deap import base
  from deap import benchmarks
  from deap.benchmarks.tools import diversity, convergence, hypervolume
  from deap.tools.indicator import hv
  from deap import creator
  from deap import tools
label_desc: Use image node_id 2 for calling a global function with example usage: hypervolume_contrib(front) and returns: map, unknown