code: def subsample(X, subsample=1, seed=0):
      
      if subsample == 1 and seed == 0:
          return X, np.arange(X.shape[0], dtype=int)
      if seed == 0:
          # this sequence is defined simply by skipping rows
          # is faster than sampling
          rows = np.arange(0, X.shape[0], subsample, dtype=int)
          n = rows.size
          Xsampled = np.array(X[rows])
      if seed > 0:
          n = int(X.shape[0]/subsample)
          np.random.seed(seed)
          Xsampled, rows = subsample_n(X, n=n)
      logg.m('... subsampled to', n, 'of', X.shape[0], 'data points')
      return Xsampled, rows
docs: Subsample a fraction of 1/subsample samples from the rows of X.
  
      Parameters
      ----------
      X : np.ndarray
          Data array.
      subsample : int
          1/subsample is the fraction of data sampled, n = X.shape[0]/subsample.
      seed : int
          Seed for sampling.
  
      Returns
      -------
      Xsampled : np.ndarray
          Subsampled X.
      rows : np.ndarray
          Indices of rows that are stored in Xsampled.