code: def get_cands_list_from_split(session, candidate_classes, doc, split):
      
      cands = []
      if split == ALL_SPLITS:
          # Get cands from all splits
          for candidate_class in candidate_classes:
              cands.append(
                  session.query(candidate_class)
                  .filter(candidate_class.document_id == doc.id)
                  .all()
              )
      else:
          # Get cands from the specified split
          for candidate_class in candidate_classes:
              cands.append(
                  session.query(candidate_class)
                  .filter(candidate_class.document_id == doc.id)
                  .filter(candidate_class.split == split)
                  .all()
              )
      return cands
docs: Return the list of list of candidates from this document based on the split.