<commit_before>#!/usr/bin/python3

# Csound Test Suite
# By <NAME> <<EMAIL> at gmail dot com>

import os
import sys

from testUI import TestApplication

try:
    # Python 3
    from tkinter import *
except:
    try:
    # Python 2
     from Tkinter import *
    except:
     pass

parserType = ""
showUIatClose = False
##csoundExecutable = r"C:/Users/new/csound-csound6-git/csound.exe "
csoundExecutable =""
sourceDirectory = "."

class Test:
    def __init__(self, fileName, description, expected=True):
        self.fileName = fileName
        self.description = ""
        self.expected = expected

def showUI(results):
    root = Tk()
    app = TestApplication(master=root)
    app.setResults(results)
    app.mainloop()
    root.destroy()

def showHelp():
    message = """Csound Test Suite by <NAME><<EMAIL>>

    Runs tests using new parser and shows return values of tests. Results
    are written to results.txt file.  To show the results using a UI, pass
    in the command "--show-ui" like so:

    ./test.py --show-ui
<commit_msg>fixing test script again ONE MORE TIME<commit_after>#!/usr/bin/python3

# Csound Test Suite
# By <NAME> <<EMAIL>yi at gmail dot com>

import os
import sys

test_ui = False

try:
    # Python 3
    from tkinter import *
    from testUI import TestApplication
    test_ui = True
except:
    try:
    # Python 2
     from Tkinter import *
     from testUI import TestApplication
     test_ui = True
    except:
     pass





parserType = ""
showUIatClose = False
##csoundExecutable = r"C:/Users/new/csound-csound6-git/csound.exe "
csoundExecutable =""
sourceDirectory = "."

class Test:
    def __init__(self, fileName, description, expected=True):
        self.fileName = fileName
        self.description = ""
        self.expected = expected

def showUI(results):
    if test_ui is True:
     root = Tk()
     app = TestApplication(master=root)
     app.setResults(results)
     app.mainloop()
     root.destroy()

def showHelp():
    message = """Csound Test Suite by <NAME><<EMAIL>>

    Runs tests using new parser and shows return values of tests. Results
    are written to results.txt file.  To show the results using a UI, pass
    in the command "--show-ui" like so:

    ./test.py --show-ui

{'fraction_non_alphanumeric': 0.10164957646009808, 'fraction_numerical': 0.0035666518056174765, 'mean_word_length': 2.8756476683937824, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '4367696', 'n_tokens_mistral': 719, 'n_tokens_neox': 702, 'n_words': 226}