original_docstring:  Helper function to split a single dataset into train, valid and test set. 
      
      args:
          ds the dataset being a tuple of (data,labels)
          split_sizes a list of fractional split sizes of howto divide up the dataset 
  
      returns:
          a list of datasets with the respective split ratios
      
docstring: Helper function to split a single dataset into train, valid and test set.
  args:
  ds the dataset being a tuple of (data,labels)
  split_sizes a list of fractional split sizes of howto divide up the dataset
  
  a list of datasets with the respective split ratios
docstring_tokens: Helper function to split a single dataset into train valid and test set . args : ds the dataset being a tuple of ( data labels ) split_sizes a list of fractional split sizes of howto divide up the dataset a list of datasets with the respective split ratios
code: def split_dataset(ds, split_sizes, permute_data=True):
      """ Helper function to split a single dataset into train, valid and test set. 
      
      args:
          ds the dataset being a tuple of (data,labels)
          split_sizes a list of fractional split sizes of howto divide up the dataset 
  
      returns:
          a list of datasets with the respective split ratios
      """
      raw_data, raw_labels = ds
      if permute_data:
          idx = range(len(raw_data))
          np.random.shuffle(idx)
          data = raw_data[idx]
          labels = raw_labels[idx]
      else:
          data = raw_data
          labels = raw_labels
      nelems = len(labels)
      nbegin = 0 
      splits = []
      for split in split_sizes:
          nend = nbegin+int(split*nelems)
          splits.append( (data[nbegin:nend], labels[nbegin:nend]) )
          nbegin = nend
      return splits
code_tokens: def split_dataset ( ds , split_sizes , permute_data = True ) : raw_data , raw_labels = ds if permute_data : idx = range ( len ( raw_data ) ) np . random . shuffle ( idx ) data = raw_data [ idx ] labels = raw_labels [ idx ] else : data = raw_data labels = raw_labels nelems = len ( labels ) nbegin = 0 splits = [ ] for split in split_sizes : nend = nbegin + int ( split * nelems ) splits . append ( ( data [ nbegin : nend ] , labels [ nbegin : nend ] ) ) nbegin = nend return splits
short_docstring: Helper function to split a single dataset into train, valid and test set.
short_docstring_tokens: Helper function to split a single dataset into train valid and test set .
comment: """ Helper function to split a single dataset into train, valid and test set. 
      
      args:
          ds the dataset being a tuple of (data,labels)
          split_sizes a list of fractional split sizes of howto divide up the dataset 
  
      returns:
          a list of datasets with the respective split ratios
      """