code: def configure_crossover(self, genome1, genome2, config):
          
          assert isinstance(genome1.fitness, (int, float))
          assert isinstance(genome2.fitness, (int, float))
          if genome1.fitness > genome2.fitness:
              parent1, parent2 = genome1, genome2
          else:
              parent1, parent2 = genome2, genome1
  
          # Inherit connection genes
          for key, cg1 in iteritems(parent1.connections):
              cg2 = parent2.connections.get(key)
              if cg2 is None:
                  # Excess or disjoint gene: copy from the fittest parent.
                  self.connections[key] = cg1.copy()
              else:
                  # Homologous gene: combine genes from both parents.
                  self.connections[key] = cg1.crossover(cg2)
  
          # Inherit node genes
          parent1_set = parent1.nodes
          parent2_set = parent2.nodes
  
          for key, ng1 in iteritems(parent1_set):
              ng2 = parent2_set.get(key)
              assert key not in self.nodes
              if ng2 is None:
                  # Extra gene: copy from the fittest parent
                  self.nodes[key] = ng1.copy()
              else:
                  # Homologous gene: combine genes from both parents.
                  self.nodes[key] = ng1.crossover(ng2)
docs: Configure a new genome by crossover from two parent genomes.