original_docstring: 
      Two Point Crossover, to be applied directly to a parents array returned by the roulette selection phase
      
docstring: Two Point Crossover, to be applied directly to a parents array returned by the roulette selection phase
docstring_tokens: Two Point Crossover to be applied directly to a parents array returned by the roulette selection phase
code: def two_point_crossover(p):
      """
      Two Point Crossover, to be applied directly to a parents array returned by the roulette selection phase
      """
      n = p.shape[2]
      swath = np.random.randint(1, n)
  
      cut1 = np.random.randint(0, n - swath)
      cut2 = cut1 + swath
  
      ps0 = p.shape[0]
      off = np.zeros((ps0, n))
  
      sel = p[:, 0, cut1:cut2]
      off[:, cut1:cut2] = sel
  
      p1 = p[:, 1]
      sel = np.array(np.split(p1[~np.array([(np.isin(p1[i], sel[i])) for i in range(len(sel))])], ps0))
  
      off[:, 0:cut1] = sel[:, 0:cut1]
      off[:, cut2:] = sel[:, cut1:]
      return off
code_tokens: def two_point_crossover ( p ) : n = p . shape [ 2 ] swath = np . random . randint ( 1 , n ) cut1 = np . random . randint ( 0 , n - swath ) cut2 = cut1 + swath ps0 = p . shape [ 0 ] off = np . zeros ( ( ps0 , n ) ) sel = p [ : , 0 , cut1 : cut2 ] off [ : , cut1 : cut2 ] = sel p1 = p [ : , 1 ] sel = np . array ( np . split ( p1 [ ~ np . array ( [ ( np . isin ( p1 [ i ] , sel [ i ] ) ) for i in range ( len ( sel ) ) ] ) ] , ps0 ) ) off [ : , 0 : cut1 ] = sel [ : , 0 : cut1 ] off [ : , cut2 : ] = sel [ : , cut1 : ] return off
short_docstring: Two Point Crossover, to be applied directly to a parents array returned by the roulette selection phase
short_docstring_tokens: Two Point Crossover to be applied directly to a parents array returned by the roulette selection phase
comment: """
      Two Point Crossover, to be applied directly to a parents array returned by the roulette selection phase
      """