class_docstr: Population class
      
class_docstr_tok: ["Population","class"]
code: def get_offspring(self, parents_size, offspring_size):
      children = []
      if len(self.fitness) < parents_size:
          for _ in range(offspring_size):
              child = copy.deepcopy(self.individual.reset())
              while child in self.population or child in children:
                  child = child.mutate()
              children.append(child)
      elif self.fitness[0] < 1e-3:
          for _ in range(offspring_size):
              child = copy.deepcopy(self.individual.reset())
              while child in self.population or child in children:
                  child = child.mutate()
              children.append(child)
      else:
          prob = np.array(self.fitness[:parents_size]) / np.sum(
              self.fitness[:parents_size]
          )
  
          for _ in range(offspring_size):
              child = copy.deepcopy(self.population[0])
              for key in child.params.keys():
                  idx = np.random.choice(range(parents_size), p=prob)
                  child.params[key] = self.population[idx].params[key]
              child = child.mutate()
              while child in self.population or child in children:
                  child = child.mutate()
              children.append(child)
  
      return children
  
imports: import math
  import logging
  import copy
  import random
  import numpy
  from itertools import permutations, combinations
  import nni
  from nni.tuner import Tuner
label_desc: Use image node_id 3 for calling the Population obj's underlying member method code with example usage: obj.get_offspring(parents_size, offspring_size) and returns: children