code: def _evalFunction(
      individual,
      name_values,
      X,
      y,
      scorer,
      cv,
      iid,
      fit_params,
      verbose=0,
      error_score="raise",
      score_cache={},
  ):
      """Developer Note:
      --------------------
      score_cache was purposefully moved to parameters, and given a dict reference.
      It will be modified in-place by _evalFunction based on it's reference.
      This is to allow for a managed, paralell memoization dict,
      and also for different memoization per instance of EvolutionaryAlgorithmSearchCV.
      Remember that dicts created inside function definitions are presistent between calls,
      So unless it is replaced this function will be memoized each call automatically.
      """
  
      parameters = _individual_to_params(individual, name_values)
      score = 0
      n_test = 0
  
      paramkey = str(individual)
      if paramkey in score_cache:
          score = score_cache[paramkey]
      else:
          for train, test in cv.split(X, y):
              assert (
                  len(train) > 0 and len(test) > 0
              ), "Training and/or testing not long enough for evaluation."
              _score = _fit_and_score(
                  estimator=individual.est,
                  X=X,
                  y=y,
                  scorer=scorer,
                  train=train,
                  test=test,
                  verbose=verbose,
                  parameters=parameters,
                  fit_params=fit_params,
                  error_score=error_score,
              )["test_scores"]
  
              if iid:
                  score += _score * len(test)
                  n_test += len(test)
              else:
                  score += _score
                  n_test += 1
  
          assert (
              n_test > 0
          ), "No fitting was accomplished, check data and cross validation method."
          score /= float(n_test)
          score_cache[paramkey] = score
  
      return (score,)
  
imports: from __future__ import division
  import os
  import warnings
  import numpy
  import random
  from deap import base, creator, tools, algorithms
  from collections import defaultdict
  from sklearn.base import clone, is_classifier
  from sklearn.model_selection._validation import _fit_and_score
  from sklearn.model_selection._search import BaseSearchCV, check_cv, _check_param_grid
  from sklearn.metrics import check_scoring
  from sklearn.utils.validation import _num_samples, indexable
label_desc: Use image node_id 7 for calling a global function with example usage: _evalFunction(individual, name_values, X, y, scorer, cv, iid, fit_params, verbose, error_score, score_cache) and returns: score