code: def kfold(x, y, folds=10, shuffled=True, multi_input=False):
      import wrangle
  
      # data input is list but multi_input is not set to True
      if isinstance(x, list) and multi_input is False:
          raise TypeError("For multi-input x, set multi_input to True")
  
      if shuffled is True:
          x, y = wrangle.array_random_shuffle(x, y, multi_input)
  
      out_x = []
      out_y = []
  
      # establish the fold size
      y_len = len(y)
      step = int(y_len / folds)
  
      lo = 0
      hi = step
  
      # create folds one by one
      for _i in range(folds):
          # handle the case for multi-input model
          if multi_input:
              fold_x = []
              for ar in x:
                  fold_x.append(ar[lo:hi])
              out_x.append(fold_x)
  
          # handle the case where model is not multi-input
          else:
              out_x.append(x[lo:hi])
  
          out_y.append(y[lo:hi])
  
          lo += step
          hi += step
  
      return out_x, out_y
  
label_desc: Use image node_id 2 for calling a global function with example usage: kfold(x, y, folds, shuffled, multi_input) and returns: out_x,  out_y