docs: def make_data_splits(label_type, train_rec_type="text_and_wordlist", max_samples=1000,
                       seed=0, tgt_dir=TGT_DIR):
      """ Creates a file with a list of prefixes (identifiers) of utterances to
      include in the test set. Test utterances must never be wordlists. Assumes
      preprocessing of label dir has already been done."""
  
      feat_dir = os.path.join(tgt_dir, "feat")
      test_prefix_fn=os.path.join(tgt_dir, "test_prefixes.txt")
      valid_prefix_fn=os.path.join(tgt_dir, "valid_prefixes.txt")
      with open(test_prefix_fn) as f:
          prefixes = f.readlines()
          test_prefixes = [("TEXT/" + prefix).strip() for prefix in prefixes]
      with open(valid_prefix_fn) as f:
          prefixes = f.readlines()
          valid_prefixes = [("TEXT/" + prefix).strip() for prefix in prefixes]
  
      label_dir = os.path.join(tgt_dir, "label")
      prefixes = get_story_prefixes(label_type, label_dir=label_dir)
      prefixes = list(set(prefixes) - set(valid_prefixes))
      prefixes = list(set(prefixes) - set(test_prefixes))
      prefixes = utils.filter_by_size(
          feat_dir, prefixes, "fbank", max_samples)
  
      if train_rec_type == "text":
          train_prefixes = prefixes
      else:
          wordlist_prefixes = [prefix for prefix in os.listdir(os.path.join(label_dir, "WORDLIST"))
                               if prefix.endswith("phonemes")]
          wordlist_prefixes = [os.path.splitext(os.path.join("WORDLIST", prefix))[0]
                               for prefix in wordlist_prefixes]
          wordlist_prefixes = utils.filter_by_size(
                  feat_dir, wordlist_prefixes, "fbank", max_samples)
          if train_rec_type == "wordlist":
              prefixes = wordlist_prefixes
          elif train_rec_type == "text_and_wordlist":
              prefixes.extend(wordlist_prefixes)
          else:
              raise PersephoneException("train_rec_type='%s' not supported." % train_rec_type)
          train_prefixes = prefixes
      random.seed(seed)
      random.shuffle(train_prefixes)
  
      return train_prefixes, valid_prefixes, test_prefixes