def split_dataset(dataset, split_at, order=None):
 n_examples = len(dataset)
 if (split_at < 0):
  raise ValueError('split_at must be non-negative')
 if (split_at >= n_examples):
  raise ValueError('split_at exceeds the dataset size')
 subset1 = SubDataset(dataset, 0, split_at, order)
 subset2 = SubDataset(dataset, split_at, n_examples, order)
 return (subset1, subset2)

def split_dataset ( dataset , split_at , order = None ) : n_examples = len ( dataset ) if ( split_at < 0 ) : raise ValueError ( 'split_at must be non-negative' ) if ( split_at >= n_examples ) : raise ValueError ( 'split_at exceeds the dataset size' ) subset1 = SubDataset ( dataset , 0 , split_at , order ) subset2 = SubDataset ( dataset , split_at , n_examples , order ) return ( subset1 , subset2 )
splits a dataset into two subsets .