Create a dict of property->ExpectedResult from information encoded in a filename.

def expected_results_of_file(filename):
    """Create a dict of property->ExpectedResult from information encoded in a filename."""
    results = {}
    for (filename_part, (expected_result, for_properties)) in _FILE_RESULTS.items():
        if filename_part in filename:
            expected_result_class = get_result_classification(expected_result)
            assert expected_result_class in {RESULT_CLASS_TRUE, RESULT_CLASS_FALSE}
            expected_result = (expected_result_class == RESULT_CLASS_TRUE)
            subproperty = None
            if len(for_properties) > 1:
                assert for_properties == _MEMSAFETY_SUBPROPERTIES and expected_result
                property = _PROP_MEMSAFETY
            else:
                property = next(iter(for_properties))
                if property in _MEMSAFETY_SUBPROPERTIES and not expected_result:
                    subproperty = property
                    property = _PROP_MEMSAFETY
            if property in results:
                raise BenchExecException(
                    "Duplicate property {} in filename {}".format(property, filename))
            results[property] = ExpectedResult(expected_result, subproperty)
    return results