code: def crossvalOne(
      model,
      X,
      y,
      params,
      nfolds,
      metric=roc_auc_score,
      predict_proba=True,
      n_jobs=-1,
      verbose=1,
  ):
      """
      Makes one cross-validation model fit-score run using provided data and parameters
      :param model: The instantiated model you wish to pass, e.g. LogisticRegression()
      :param X: The independent variable data
      :param y: The response variable data
      :param params: The parameters passed through to the model from the parameter grid
      :param nfolds: The number of folds you wish to use for cross-validation
      :param metric: The metric you wish to use to score the crossval predictions using
      :param predict_proba: Choice between using 'predict_proba' and 'predict' for scoring routine.
          Default True means predict_proba and False means predict
      :param n_jobs: Number of cores to use in parallelization (defaults to -1: all cores)
      :param verbose: The level of verbosity of reporting updates on parallel process
          Default is 10 (send an update at the completion of each job)
      :return: Returns the mean of the cross-validation scores
      """
      if "random_state" in params.keys():
          random_state = params["random_state"]
      else:
          random_state = None
  
      if nfolds >= X.shape[0]:
          cv = LeaveOneOut()
      else:
          cv = StratifiedKFold(
              n_splits=nfolds, shuffle=True, random_state=random_state
          )
  
      train_indices, test_indices = zip(*cv.split(X, y))
      if isinstance(model, BaseEstimator):
          fitted_models = Parallel(n_jobs=n_jobs, verbose=verbose)(
              delayed(fitOne)(
                  type(model),
                  np.asarray(X)[train_index],
                  np.asarray(y)[train_index],
                  params,
              )
              for train_index in train_indices
          )
      else:
          fitted_models = Parallel(n_jobs=n_jobs, verbose=verbose)(
              delayed(fitOne)(
                  model,
                  np.asarray(X)[train_index],
                  np.asarray(y)[train_index],
                  params,
              )
              for train_index in train_indices
          )
      if nfolds >= X.shape[0]:
          score = scoreLeaveOneOut(
              fitted_models, test_indices, X, y, metric, predict_proba
          )
          return score
      else:
          scores = Parallel(n_jobs=n_jobs, verbose=0)(
              delayed(scoreOne)(
                  fitted_model,
                  np.asarray(X)[test_index],
                  np.asarray(y)[test_index],
                  metric,
                  predict_proba,
              )
              for fitted_model, test_index in zip(
                  fitted_models, test_indices
              )
          )
          return np.mean(scores)
  
file_path: parfit/parfit/crossval.py
imports: from joblib import Parallel, delayed
  from sklearn.base import BaseEstimator
  from sklearn.model_selection import StratifiedKFold, LeaveOneOut
  from sklearn.metrics import roc_auc_score
  import numpy
  from .fit import fitOne
  from .score import scoreOne, scoreLeaveOneOut
  import warnings
label_desc: Use image node_id 1 for calling a global function with example usage: crossvalOne(model, X, y, params, nfolds, metric, predict_proba, n_jobs, verbose) and returns: score, np