def update_concat_dataset_cache(self, ds_keys, preds_list, key_prefix="concat"):
    """
    if preds_list[i] is None, then the ith dataset won't be cut by confidence.
    """
    assert len(ds_keys) == len(preds_list)
    assert all(ds_key[1:] == ds_keys[0][1:] for ds_key in ds_keys)
    new_split = "-".join((key_prefix,) + tuple(ds_key[0] for ds_key in ds_keys))
    logger.info("Concating %d dataset %s ..." % (len(ds_keys), new_split))
    new_ds_key = (new_split, ) + ds_keys[0][1:]

    datasets = []
    for ds_key, preds in zip(ds_keys, preds_list):
      dataset = self.get_dataset(*ds_key)
      if preds is None:
        datasets.append(dataset)
        continue
      new_labels = dataset.tensors[-1]
      confident_indices = []
      for i in range(len(new_labels)):
        if preds[i,new_labels[i]] >= self.args.confidence_threshold:
          confident_indices.append(i)
      logger.info(
        "Labeled %d confident examples out of %d examples for dataset %s" % (
        len(confident_indices), len(new_labels), str(ds_key)))
      if len(confident_indices) > 0:
        datasets.append(Subset(dataset, confident_indices))

    self.set_dataset(ConcatDataset(datasets), new_ds_key)
    # self.datasets[new_ds_key] = ConcatDataset(datasets)
    logger.info("Construct new dataset %s with %d examples" % (
      str(new_ds_key), len(self.datasets[new_ds_key])))
    return new_ds_key

    if preds_list[i] is None, then the ith dataset won't be cut by confidence.
    
xtune/src/pequod/training/trainer.py