code: def split_samples(X, y, fractions=[0.75, 0.25], random_state=None):
      """Split samples into training, test, and cross-validation sets
  
      Parameters
      ----------
      X, y : array_like
          leading dimension n_samples
      fraction : array_like
          length n_splits.  If the fractions do not add to 1, they will be
          re-normalized.
      random_state : None, int, or RandomState object
          random seed, or random number generator
      """
      X = np.asarray(X)
      y = np.asarray(y)
  
      if X.shape[0] != y.shape[0]:
          raise ValueError(
              "X and y should have the same leading dimension"
          )
  
      n_samples = X.shape[0]
  
      fractions = np.asarray(fractions).ravel().cumsum()
      fractions /= fractions[-1]
      fractions *= n_samples
      N = np.concatenate([[0], fractions.astype(int)])
      N[-1] = n_samples  # in case of roundoff errors
  
      random_state = sk_check_random_state(random_state)
      indices = np.arange(len(y))
      random_state.shuffle(indices)
  
      X_divisions = tuple(
          X[indices[N[i] : N[i + 1]]] for i in range(len(fractions))
      )
      y_divisions = tuple(
          y[indices[N[i] : N[i + 1]]] for i in range(len(fractions))
      )
  
      return X_divisions, y_divisions
  
file_path: astroML/astroML/utils/utils.py
imports: import numpy
  from scipy import linalg
  from sklearn.utils import check_random_state
  from astroML.utils.decorators import deprecated
  from astroML.utils.exceptions import AstroMLDeprecationWarning
label_desc: Use image node_id 4 for calling a global function with example usage: split_samples(X, y, fractions, random_state) and returns: X_divisions,  y_divisions