def _WriteXmlFile(filename, suite_duration, results):
xml_file = open(filename, '<STR_LIT:w>')<EOL>xml_file.write('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(sys.argv[<NUM_LIT:0>], len(results), suite_duration))<EOL>for result in results:<EOL><INDENT>xml_file.write('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(result.name, result.duration))<EOL>if result.properties:<EOL><INDENT>xml_file.write('<STR_LIT>')<EOL>for name in result.properties:<EOL><INDENT>value = result.properties[name]<EOL>if isinstance(value, float):<EOL><INDENT>formatted = '<STR_LIT>' % value<EOL><DEDENT>else:<EOL><INDENT>formatted = str(value)<EOL><DEDENT>xml_file.write('<STR_LIT>' %<EOL>(name, formatted))<EOL><DEDENT>xml_file.write('<STR_LIT>')<EOL><DEDENT>xml_file.write('<STR_LIT>')<EOL><DEDENT>xml_file.write('<STR_LIT>')<EOL>xml_file.close()<EOL>
Given a list of _BenchmarkResults, writes XML test results to filename.