code: def get_docs_from_split(session, candidate_classes, split):
      
      # Only grab the docs containing candidates from the given split.
      sub_query = session.query(Candidate.id).filter(Candidate.split == split).subquery()
      split_docs = set()
      for candidate_class in candidate_classes:
          split_docs.update(
              cand.document
              for cand in session.query(candidate_class)
              .filter(candidate_class.id.in_(sub_query))
              .all()
          )
      return split_docs
docs: Return a list of documents that contain the candidates in the split.