<commit_before>#!/usr/bin/env python
"""
Simple script to report JUnit test results

"""

import sys

def report_results(xml_filename):
    xunitparser = None
    try:
        import xunitparser
    except ImportError as e:
        sys.stderr.write("xunitparser module not availble results report not avaliable\n")
        sys.stderr.write("Import error was: %s\n" % repr(e))

     
    if xunitparser is not None:
        ts, tr = xunitparser.parse(open(xml_filename))
        report = {'success': 0, 'skipped': 0, 'failed': 0, 'errored': 0}
        for tc in ts:
            report[tc.result] += 1
           
        print 'Test Report:', report
        if report['failed'] or report['errored']:
            return 1
        
        return 0

if __name__ == "__main__":
    if len(sys.argv) is not 2:
        print "Please specify a result file"
        exit(1)
        <commit_msg>report_results.py python3 fix<commit_after>#!/usr/bin/env python
"""
Simple script to report JUnit test results

"""

import sys

def report_results(xml_filename):
    xunitparser = None
    try:
        import xunitparser
    except ImportError as e:
        sys.stderr.write("xunitparser module not availble results report not avaliable\n")
        sys.stderr.write("Import error was: %s\n" % repr(e))

     
    if xunitparser is not None:
        ts, tr = xunitparser.parse(open(xml_filename))
        report = {'success': 0, 'skipped': 0, 'failed': 0, 'errored': 0}
        for tc in ts:
            report[tc.result] += 1
           
        print('Test Report:', report)
        if report['failed'] or report['errored']:
            return 1
        
        return 0

if __name__ == "__main__":
    if len(sys.argv) is not 2:
        print("Please specify a result file")
        exit(1)
        
{'fraction_non_alphanumeric': 0.1111731843575419, 'fraction_numerical': 0.010614525139664804, 'mean_word_length': 2.221223021582734, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '75443', 'n_tokens_mistral': 569, 'n_tokens_neox': 542, 'n_words': 170}