code: def train_test_split(*arrays, **options):
      """Split arrays or matrices into random train and test subsets
  
      Parameters
      ----------
      *arrays : sequence of indexables with same length / shape[0]
          Allowed inputs are lists, numpy arrays, scipy-sparse
          matrices or pandas dataframes.
  
      test_size : float, int or None, optional (default=None)
          If float, should be between 0.0 and 1.0 and represent the proportion
          of the dataset to include in the test split. If int, represents the
          absolute number of test samples. If None, the value is set to the
          complement of the train size. If ``train_size`` is also None, it will
          be set to 0.25.
  
      train_size : float, int, or None, (default=None)
          If float, should be between 0.0 and 1.0 and represent the
          proportion of the dataset to include in the train split. If
          int, represents the absolute number of train samples. If None,
          the value is automatically set to the complement of the test size.
  
      random_state : int, RandomState instance or None, optional (default=None)
          If int, random_state is the seed used by the random number generator;
          If RandomState instance, random_state is the random number generator;
          If None, the random number generator is the RandomState instance used
          by `np.random`.
  
      shuffle : boolean, optional (default=True)
          Whether or not to shuffle the data before splitting. If shuffle=False
          then stratify must be None.
  
      stratify : array-like or None (default=None)
          If not None, data is split in a stratified fashion, using this as
          the class labels.
  
      Returns
      -------
      splitting : list, length=2 * len(arrays)
          List containing train-test split of inputs.
  
      Examples
      --------
      >>> import mars.tensor as mt
      >>> from mars.learn.model_selection import train_test_split
      >>> X, y = mt.arange(10).reshape((5, 2)), range(5)
      >>> X.execute()
      array([[0, 1],
             [2, 3],
             [4, 5],
             [6, 7],
             [8, 9]])
      >>> list(y)
      [0, 1, 2, 3, 4]
  
      >>> X_train, X_test, y_train, y_test = train_test_split(
      ...     X, y, test_size=0.33, random_state=42)
      ...
      >>> X_train.execute()
      array([[8, 9],
             [0, 1],
             [4, 5]])
      >>> y_train.execute()
      array([4, 0, 2])
      >>> X_test.execute()
      array([[2, 3],
             [6, 7]])
      >>> y_test.execute()
      array([1, 3])
  
      >>> train_test_split(y, shuffle=False)
      [array([0, 1, 2]), array([3, 4])]
  
      """
  
      n_arrays = len(arrays)
      if n_arrays == 0:
          raise ValueError("At least one array required as input")
      test_size = options.pop("test_size", None)
      train_size = options.pop("train_size", None)
      random_state = options.pop("random_state", None)
      stratify = options.pop("stratify", None)
      shuffle = options.pop("shuffle", True)
      session = options.pop("session", None)
      run_kwargs = options.pop("run_kwargs", None)
  
      if options:
          raise TypeError(f"Invalid parameters passed: {options}")
  
      arrays = indexable(
          *arrays, session=session, run_kwargs=run_kwargs
      )
  
      n_samples = _num_samples(arrays[0])
      n_train, n_test = _validate_shuffle_split(
          n_samples, test_size, train_size, default_test_size=0.25
      )
  
      if shuffle is False:
          if stratify is not None:  # pragma: no cover
              raise ValueError(
                  "Stratified train/test split is not implemented for shuffle=False"
              )
  
          iterables = (
              (a[:n_train], a[n_train : n_train + n_test])
              for a in arrays
          )
      else:
          if stratify is not None:  # pragma: no cover
              raise NotImplementedError(
                  "stratify is not implemented yet"
              )
          else:
              shuffled_arrays = shuffle_arrays(
                  *arrays, random_state=random_state
              )
              if not isinstance(shuffled_arrays, tuple):
                  shuffled_arrays = (shuffled_arrays,)
              iterables = (
                  (a[:n_train], a[n_train : n_train + n_test])
                  for a in shuffled_arrays
              )
  
      return list(
          ExecutableTuple(chain.from_iterable(iterables)).execute(
              session=session, **(run_kwargs or dict())
          )
      )
  
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 1 for calling a global function with example usage: train_test_split() and returns: list