code: def split(train_indexes, test_indexes, *args):
      """
      For each arg return a train and test subsets defined by indexes provided
      in train_indexes and test_indexes
      """
      ret = []
      for arg in args:
          arg = np.asanyarray(arg)
          arg_train = arg[train_indexes]
          arg_test = arg[test_indexes]
          ret.append(arg_train)
          ret.append(arg_test)
      return ret
  
imports: from statsmodels.compat.python import lrange
  import numpy
  from itertools import combinations
label_desc: Use image node_id 1 for calling a global function with example usage: split(train_indexes, test_indexes) and returns: ret