code: def diversity(population):
      nind = len(population)
      ndim = len(population[0])
      d = [0.0] * ndim
      for x in population:
          d = [di + xi for di, xi in zip(d, x)]
      d = [di / nind for di in d]
      return math.sqrt(
          sum(
              (di - xi) ** 2 for x in population for di, xi in zip(d, x)
          )
      )
  
file_path: deap/deap/benchmarks/movingpeaks.py
imports: import math
  import itertools
  import random
  from collections.abc import Sequence
label_desc: Use image node_id 4 for calling a global function with example usage: diversity(population) and returns: math