code: def make_data_splits(self, max_samples, valid_story=None, test_story=None):
          
          # TODO Make this also work with wordlists.
          if valid_story or test_story:
              if not (valid_story and test_story):
                  raise PersephoneException(
                      "We need a valid story if we specify a test story "
                      "and vice versa. This shouldn't be required but for "
                      "now it is.")
  
              train, valid, test = make_story_splits(valid_story, test_story,
                                                     max_samples,
                                                     self.label_type,
                                                     tgt_dir=str(self.tgt_dir))
          else:
              train, valid, test = make_data_splits(self.label_type,
                                                    train_rec_type=self.train_rec_type,
                                                    max_samples=max_samples,
                                                    tgt_dir=str(self.tgt_dir))
          self.train_prefixes = train
          self.valid_prefixes = valid
          self.test_prefixes = test
docs: Split data into train, valid and test groups