code: def _validate_shuffle_split(
      n_samples, test_size, train_size, default_test_size=None
  ):
      """
      Validation helper to check if the test/test sizes are meaningful wrt to the
      size of the data (n_samples)
      """
      if test_size is None and train_size is None:
          test_size = default_test_size
  
      test_size_type = np.asarray(test_size).dtype.kind
      train_size_type = np.asarray(train_size).dtype.kind
  
      if (
          test_size_type == "i"
          and (test_size >= n_samples or test_size <= 0)
          or test_size_type == "f"
          and (test_size <= 0 or test_size >= 1)
      ):
          raise ValueError(
              f"test_size={test_size} should be either positive and smaller"
              f" than the number of samples {n_samples} or a float in the "
              "(0, 1) range"
          )
  
      if (
          train_size_type == "i"
          and (train_size >= n_samples or train_size <= 0)
          or train_size_type == "f"
          and (train_size <= 0 or train_size >= 1)
      ):
          raise ValueError(
              f"train_size={train_size} should be either positive and smaller"
              f" than the number of samples {n_samples} or a float in the "
              "(0, 1) range"
          )
  
      if train_size is not None and train_size_type not in (
          "i",
          "f",
      ):  # pragma: no cover
          raise ValueError(
              f"Invalid value for train_size: {train_size}"
          )
      if test_size is not None and test_size_type not in ("i", "f"):
          raise ValueError(f"Invalid value for test_size: {test_size}")
  
      if (
          train_size_type == "f"
          and test_size_type == "f"
          and train_size + test_size > 1
      ):
          raise ValueError(
              f"The sum of test_size and train_size = {train_size + test_size}, "
              "should be in the (0, 1) range. Reduce test_size and/or train_size."
          )
  
      if test_size_type == "f":
          n_test = ceil(test_size * n_samples)
      elif test_size_type == "i":
          n_test = float(test_size)
  
      if train_size_type == "f":
          n_train = floor(train_size * n_samples)
      elif train_size_type == "i":  # pragma: no cover
          n_train = float(train_size)
  
      if train_size is None:
          n_train = n_samples - n_test
      elif test_size is None:
          n_test = n_samples - n_train
  
      if n_train + n_test > n_samples:  # pragma: no cover
          raise ValueError(
              f"The sum of train_size and test_size = {n_train + n_test}, "
              f"should be smaller than the number of samples {n_samples}. "
              "Reduce test_size and/or train_size."
          )
  
      n_train, n_test = int(n_train), int(n_test)
  
      if n_train == 0:  # pragma: no cover
          raise ValueError(
              f"With n_samples={n_samples}, test_size={test_size} and "
              f"train_size={train_size}, the resulting train set will "
              f"be empty. Adjust any of the aforementioned parameters."
          )
  
      return n_train, n_test
  
imports: import numbers
  from abc import ABCMeta, abstractmethod
  from itertools import chain
  from math import ceil, floor
  import numpy
  from ...core import ExecutableTuple
  from ...None import tensor
  from ...tensor.utils import check_random_state
  from ..utils import shuffle
  from ..utils.validation import indexable, _num_samples
label_desc: Use image node_id 2 for calling a global function with example usage: _validate_shuffle_split(n_samples, test_size, train_size, default_test_size) and returns: n_train,  n_test