code: def mutSet(individual):
      """Mutation that pops or add an element."""
      if random.random() < 0.5:
          if len(individual) > 0:  # We cannot pop from an empty set
              individual.remove(
                  random.choice(sorted(tuple(individual)))
              )
      else:
          individual.add(random.randrange(NBR_ITEMS))
      return (individual,)
  
file_path: deap/examples/ga/knapsack.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: mutSet(individual) and returns: individual