code: def main():
      random.seed(64)
  
      pop = toolbox.population(n=300)
  
      # Numpy equality function (operators.eq) between two arrays returns the
      # equality element wise, which raises an exception in the if similar()
      # check of the hall of fame. Using a different equality function like
      # numpy.array_equal or numpy.allclose solve this issue.
      hof = tools.HallOfFame(1, similar=numpy.array_equal)
  
      stats = tools.Statistics(lambda ind: ind.fitness.values)
      stats.register("avg", numpy.mean)
      stats.register("std", numpy.std)
      stats.register("min", numpy.min)
      stats.register("max", numpy.max)
  
      algorithms.eaSimple(
          pop,
          toolbox,
          cxpb=0.5,
          mutpb=0.2,
          ngen=40,
          stats=stats,
          halloffame=hof,
      )
  
      return pop, stats, hof
  
file_path: deap/examples/ga/onemax_numpy.py
imports: import random
  import numpy
  from deap import algorithms
  from deap import base
  from deap import creator
  from deap import tools
label_desc: Use image node_id 3 for calling a global function with example usage: main() and returns: pop,  stats,  hof