def compute_test_pairs(job, input_files, format_function):
    """Takes the outputs of match_files and parse_input_files and constructs a new dictionary with results
    to compare. For all the files in the job that are 'present' and included in input_files, a dictionary entry
    keyed by the file name is created, containing:
    - The 'name' of the file (the key, at the moment),
    - The 'ground_truth' tagging from the results file, and
    - The computed 'test_input' from the supplied format_function, which takes the 'fullpath' of the input file as
      its only argument
    """
    test_pairs = {}
    for f in job:
        if not job[f]['present']:
            continue
        if f not in input_files:
            raise ValueError('Input file %s not found' % f)
        test_pairs[f] = {
            'name': f,
            'ground_truth': job[f]['text'],
            'test_input': format_function(input_files[f]['fullpath'])
        }
    return test_pairs