def parse_table_definition_file(file, options):
    '''
    This function parses the input to get run sets and columns.
    The param 'file' is an XML file defining the result files and columns.

    If column titles are given in the XML file,
    they will be searched in the result files.
    If no title is given, all columns of the result file are taken.

    @return: a list of RunSetResult objects
    '''
    logging.info("Reading table definition from '%s'...", file)
    if not os.path.isfile(file):
        logging.error("File '%s' does not exist.", file)
        exit(1)

    try:
        tableGenFile = ElementTree.ElementTree().parse(file)
    except __HOLE__ as e:
        logging.error('Could not read result file %s: %s', file, e)
        exit(1)
    except ElementTree.ParseError as e:
        logging.error('Table file %s is invalid: %s', file, e)
        exit(1)
    if 'table' != tableGenFile.tag:
        logging.error("Table file %s is invalid: It's root element is not named 'table'.", file)
        exit(1)

    defaultColumnsToShow = extract_columns_from_table_definition_file(tableGenFile, file)

    return Util.flatten(
        parallel.map(
            handle_tag_in_table_definition_file,
            tableGenFile,
            itertools.repeat(file),
            itertools.repeat(defaultColumnsToShow),
            itertools.repeat(options)))
dataset/ETHPy150Open sosy-lab/benchexec/benchexec/tablegenerator/__init__.py/parse_table_definition_file