code: def get_splitter(
      self, D: AbstractDataManager
  ) -> Union[BaseCrossValidator, _RepeatedSplits, BaseShuffleSplit]:
      if self.resampling_strategy_args is None:
          self.resampling_strategy_args = {}
  
      if self.resampling_strategy is not None and not isinstance(
          self.resampling_strategy, str
      ):
          if "groups" not in self.resampling_strategy_args:
              self.resampling_strategy_args["groups"] = None
  
          if isinstance(
              self.resampling_strategy,
              (BaseCrossValidator, _RepeatedSplits, BaseShuffleSplit),
          ):
              self.check_splitter_resampling_strategy(
                  X=D.data["X_train"],
                  y=D.data["Y_train"],
                  groups=self.resampling_strategy_args.get("groups"),
                  task=D.info["task"],
                  resampling_strategy=self.resampling_strategy,
              )
              return self.resampling_strategy
  
          # If it got to this point, we are dealing with a non-supported
          # re-sampling strategy
          raise ValueError(
              "Unsupported resampling strategy {}/{} provided".format(
                  self.resampling_strategy,
                  type(self.resampling_strategy),
              )
          )
  
      y = D.data["Y_train"]
      shuffle = self.resampling_strategy_args.get("shuffle", True)
      train_size = 0.67
      if self.resampling_strategy_args:
          train_size_from_user = self.resampling_strategy_args.get(
              "train_size"
          )
          if train_size_from_user is not None:
              train_size = float(train_size_from_user)
      test_size = float("%.4f" % (1 - train_size))
  
      if (
          D.info["task"] in CLASSIFICATION_TASKS
          and D.info["task"] != MULTILABEL_CLASSIFICATION
      ):
          y = y.ravel()
          if self.resampling_strategy in [
              "holdout",
              "holdout-iterative-fit",
          ]:
              if shuffle:
                  try:
                      cv = StratifiedShuffleSplit(
                          n_splits=1,
                          test_size=test_size,
                          random_state=1,
                      )
                      test_cv = copy.deepcopy(cv)
                      next(test_cv.split(y, y))
                  except ValueError as e:
                      if (
                          "The least populated class in y has only"
                          in e.args[0]
                      ):
                          cv = CustomStratifiedShuffleSplit(
                              n_splits=1,
                              test_size=test_size,
                              random_state=1,
                          )
                      else:
                          raise e
              else:
                  tmp_train_size = int(
                      np.floor(train_size * y.shape[0])
                  )
                  test_fold = np.zeros(y.shape[0])
                  test_fold[:tmp_train_size] = -1
                  cv = PredefinedSplit(test_fold=test_fold)
                  cv.n_splits = 1  # As sklearn is inconsistent here
          elif self.resampling_strategy in [
              "cv",
              "cv-iterative-fit",
              "partial-cv",
              "partial-cv-iterative-fit",
          ]:
              if shuffle:
                  try:
                      with warnings.catch_warnings():
                          warnings.simplefilter("error")
                          cv = StratifiedKFold(
                              n_splits=self.resampling_strategy_args[
                                  "folds"
                              ],
                              shuffle=shuffle,
                              random_state=1,
                          )
                          test_cv = copy.deepcopy(cv)
                          next(test_cv.split(y, y))
                  except UserWarning as e:
                      print(e)
                      if (
                          "The least populated class in y has only"
                          in e.args[0]
                      ):
                          cv = CustomStratifiedKFold(
                              n_splits=self.resampling_strategy_args[
                                  "folds"
                              ],
                              shuffle=shuffle,
                              random_state=1,
                          )
                      else:
                          raise e
              else:
                  cv = KFold(
                      n_splits=self.resampling_strategy_args["folds"],
                      shuffle=shuffle,
                  )
          else:
              raise ValueError(self.resampling_strategy)
      else:
          if self.resampling_strategy in [
              "holdout",
              "holdout-iterative-fit",
          ]:
              # TODO shuffle not taken into account for this
              if shuffle:
                  cv = ShuffleSplit(
                      n_splits=1, test_size=test_size, random_state=1
                  )
              else:
                  tmp_train_size = int(
                      np.floor(train_size * y.shape[0])
                  )
                  test_fold = np.zeros(y.shape[0])
                  test_fold[:tmp_train_size] = -1
                  cv = PredefinedSplit(test_fold=test_fold)
                  cv.n_splits = 1  # As sklearn is inconsistent here
          elif self.resampling_strategy in [
              "cv",
              "partial-cv",
              "partial-cv-iterative-fit",
          ]:
              random_state = 1 if shuffle else None
              cv = KFold(
                  n_splits=self.resampling_strategy_args["folds"],
                  shuffle=shuffle,
                  random_state=random_state,
              )
          else:
              raise ValueError(self.resampling_strategy)
      return cv
  
imports: from typing import Any, Dict, List, Optional, Sequence, Tuple, TypeVar, Union, cast
  import copy
  import json
  import logging
  import multiprocessing
  import warnings
  import numpy
  import pandas
  import pandas
  import scipy.sparse
  from ConfigSpace import Configuration
  from sklearn.base import BaseEstimator
  from sklearn.model_selection import BaseCrossValidator, KFold, PredefinedSplit, ShuffleSplit, StratifiedKFold, StratifiedShuffleSplit, train_test_split
  from sklearn.model_selection._split import BaseShuffleSplit, _RepeatedSplits
  from smac.tae import StatusType, TAEAbortException
  from autosklearn.automl_common.common.utils.backend import Backend
  from autosklearn.constants import CLASSIFICATION_TASKS, MULTILABEL_CLASSIFICATION, MULTIOUTPUT_REGRESSION, REGRESSION_TASKS
  from autosklearn.data.abstract_data_manager import AbstractDataManager
  from autosklearn.data.validation import SUPPORTED_FEAT_TYPES, SUPPORTED_TARGET_TYPES
  from autosklearn.evaluation.abstract_evaluator import TYPE_ADDITIONAL_INFO, AbstractEvaluator, _fit_and_suppress_warnings
  from autosklearn.evaluation.splitter import CustomStratifiedKFold, CustomStratifiedShuffleSplit
  from autosklearn.metrics import Scorer
  from autosklearn.pipeline.base import PIPELINE_DATA_DTYPE
  from autosklearn.pipeline.components.base import IterativeComponent, ThirdPartyComponents
  from autosklearn.util.logging_ import PicklableClientLogger
label_desc: Use image node_id 8 for calling the TrainEvaluator obj's underlying member method code with example usage: obj.get_splitter(D) and returns: cv, self