def get_docs_from_split(session, candidate_classes, split):
<EOL>sub_query = session.query(Candidate.id).filter(Candidate.split == split).subquery()<EOL>split_docs = set()<EOL>for candidate_class in candidate_classes:<EOL><INDENT>split_docs.update(<EOL>cand.document<EOL>for cand in session.query(candidate_class)<EOL>.filter(candidate_class.id.in_(sub_query))<EOL>.all()<EOL>)<EOL><DEDENT>return split_docs<EOL>
Return a list of documents that contain the candidates in the split.