def parse_file(file_name, res=False):
    """
    Parses file and returns the positive instances for each query.

    :param file_name: Name of file to be parsed
    :return lists of lines [[qid, label, en_id, ...], ...], lines with null entities are separated
    """
    null_lines = []
    file_lines = []
    efile = open(file_name, "r")
    for line in efile.readlines():
        if line.strip() == "":
            continue
        cols = line.strip().split("\t")
        if (not res) and (cols[2].strip() == "*NONE*"):
            null_lines.append(cols)
        else:
            file_lines.append(cols)
    return file_lines, null_lines