code: def stratified_continuous_folds(y, nfold):
      """
      Create primitive stratified folds for continuous data.
      Should be digestible by lightgbm.cv function.
      """
      if isinstance(y, pd_Series):
          y = y.values
      elements = len(y)
      assert elements >= nfold, "more splits then elements."
      sorted = np.argsort(y)
      val = [sorted[range(i, len(y), nfold)] for i in range(nfold)]
      for v in val:
          yield (np.setdiff1d(range(elements), v), v)
  
imports: from .compat import pd_DataFrame, pd_Series, pd_read_parquet
  import numpy
  from numpy.random import RandomState
  import blosc
  import dill
  from typing import Union, List, Dict, Optional
label_desc: Use image node_id 4 for calling a global function with example usage: stratified_continuous_folds(y, nfold) without return types