class_docstr: Helper class to determine properties from datatype strings.
class_docstr_tok: ["Helper","class","to","determine","properties","from","datatype","strings","."]
docstr: Splits a list of data into train/valid/test folds. The members of these folds
  are randomized (in a consistent manner) by a seed. This is a convenience
  function for datasets that do not have a canonical split.
  
  :param fold:
     parlai fold/datatype
  :param data:
      List of data examples to be split
  :param train_frac:
      Fraction of data to be used for the "train" fold. train_frac, valid_frac, and test_frac should sum to 1.
  :param valid_frac:
      Fraction of data to be used for the "valid" fold. train_frac, valid_frac, and test_frac should sum to 1.
  :param test_frac:
      Fraction of data to be used for the "test" fold. train_frac, valid_frac, and test_frac should sum to 1.
  :param seed:
      Seed for shuffling
docstr_tok: ["Splits","a","list","of","data","into","train\/valid\/test","folds",".","The","members","of","these","folds","are","randomized","(","in","a","consistent","manner",")","by","a","seed",".","This","is","a","convenience","function","for","datasets","that","do","not","have","a","canonical","split",".",":","param","fold",":","parlai","fold\/datatype",":","param","data",":","List","of","data","examples","to","be","split",":","param","train_frac",":","Fraction","of","data","to","be","used","for","the","``","train","''","fold",".","train_frac",",","valid_frac",",","and","test_frac","should","sum","to","1.",":","param","valid_frac",":","Fraction","of","data","to","be","used","for","the","``","valid","''","fold",".","train_frac",",","valid_frac",",","and","test_frac","should","sum","to","1.",":","param","test_frac",":","Fraction","of","data","to","be","used","for","the","``","test","''","fold",".","train_frac",",","valid_frac",",","and","test_frac","should","sum","to","1.",":","param","seed",":","Seed","for","shuffling"]
code: def split_data_by_fold(
      cls,
      fold: str,
      data: List,
      train_frac: float,
      valid_frac: float,
      test_frac: float,
      seed: int = 42,
  ):
      """
      Splits a list of data into train/valid/test folds. The members of these folds
      are randomized (in a consistent manner) by a seed. This is a convenience
      function for datasets that do not have a canonical split.
  
      :param fold:
         parlai fold/datatype
      :param data:
          List of data examples to be split
      :param train_frac:
          Fraction of data to be used for the "train" fold. train_frac, valid_frac, and test_frac should sum to 1.
      :param valid_frac:
          Fraction of data to be used for the "valid" fold. train_frac, valid_frac, and test_frac should sum to 1.
      :param test_frac:
          Fraction of data to be used for the "test" fold. train_frac, valid_frac, and test_frac should sum to 1.
      :param seed:
          Seed for shuffling
      """
      assert train_frac + valid_frac + test_frac == 1
      if "train" in fold:
          start = 0.0
          end = train_frac
      elif "valid" in fold:
          start = train_frac
          end = train_frac + valid_frac
      else:
          start = train_frac + valid_frac
          end = 1.0
  
      random.Random(seed).shuffle(data)
      return data[int(start * len(data)) : int(end * len(data))]
  
file_path: ParlAI/parlai/utils/data.py
imports: import random
  from typing import List
label_desc: Use image node_id 7 for calling the DatatypeHelper obj's underlying member method code with example usage: obj.split_data_by_fold(cls, fold, data, train_frac, valid_frac, test_frac, seed) and returns: data