def get_cands_list_from_split(session, candidate_classes, doc, split):
cands = []<EOL>if split == ALL_SPLITS:<EOL><INDENT>for candidate_class in candidate_classes:<EOL><INDENT>cands.append(<EOL>session.query(candidate_class)<EOL>.filter(candidate_class.document_id == doc.id)<EOL>.all()<EOL>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for candidate_class in candidate_classes:<EOL><INDENT>cands.append(<EOL>session.query(candidate_class)<EOL>.filter(candidate_class.document_id == doc.id)<EOL>.filter(candidate_class.split == split)<EOL>.all()<EOL>)<EOL><DEDENT><DEDENT>return cands<EOL>
Return the list of list of candidates from this document based on the split.