original_docstring: Tournament Selection
  
      Continually selects the top scoring creature in a set of 4.
  
      Args:
          population: creature objects.
          s: size of the elite population.
      Returns:
          Object: array of chosen creatures based on the top scores in small samples.
      
docstring: Tournament Selection
  Continually selects the top scoring creature in a set of 4.
docstring_tokens: Tournament Selection Continually selects the top scoring creature in a set of 4 .
code: def tournament_selection(population,s):
      """Tournament Selection
  
      Continually selects the top scoring creature in a set of 4.
  
      Args:
          population: creature objects.
          s: size of the elite population.
      Returns:
          Object: array of chosen creatures based on the top scores in small samples.
      """
      sample = []
      while (len(sample) < len(population) - s):
          sample.append(max(np.random.choice(population, size=4),key=lambda x: x.score))
      return sample
code_tokens: def tournament_selection ( population , s ) : sample = [ ] while ( len ( sample ) < len ( population ) - s ) : sample . append ( max ( np . random . choice ( population , size = 4 ) , key = lambda x : x . score ) ) return sample
short_docstring: Tournament Selection
  Continually selects the top scoring creature in a set of 4.
short_docstring_tokens: Tournament Selection Continually selects the top scoring creature in a set of 4 .
comment: """Tournament Selection
  
      Continually selects the top scoring creature in a set of 4.
  
      Args:
          population: creature objects.
          s: size of the elite population.
      Returns:
          Object: array of chosen creatures based on the top scores in small samples.
      """