<commit_before>from collections import deque
from os import path
import multiprocessing
import Tkinter as tk
import ImageTk
import ttk

import Image as PIL_Image
import numpy

from pqhelper import easy, data, base
_this_path = path.abspath(path.split(__file__)[0])


class GUI(object):
    """Provide a common GUI for all PQ game types."""
    def __init__(self):
        # setup the root and tab shell
        self._root = tk.Tk()
        self._root.title('PQ Helper')
        notebook = ttk.Notebook(self._root)
        # setup capture
        capture_tab = ttk.Frame(notebook)
        notebook.add(capture_tab, text='Capture')
        _GenericGameGUI(capture_tab, easy.capture_solution)
        # setup versus
        versus_tab = ttk.Frame(notebook)
        notebook.add(versus_tab, text='Versus')
        _GenericGameGUI(versus_tab, easy.versus_summaries)
        # done
        notebook.pack()

    def start(self):
        """Start the tkinter mainloop."""
        self._root.mainloop()


class _GenericGameGUI(object):<commit_msg>bugfix. for some reason (copied old, bad code), GUI was overriding start instead of run. Neither is necessary, so just moved mainloop() to __init__.<commit_after>from collections import deque
from os import path
import multiprocessing
import Tkinter as tk
import ImageTk
import ttk

import Image as PIL_Image
import numpy

from pqhelper import easy, data, base
_this_path = path.abspath(path.split(__file__)[0])


class GUI(object):
    """Provide a common GUI for all PQ game types."""
    def __init__(self):
        # setup the root and tab shell
        self._root = tk.Tk()
        self._root.title('PQ Helper')
        notebook = ttk.Notebook(self._root)
        # setup capture
        capture_tab = ttk.Frame(notebook)
        notebook.add(capture_tab, text='Capture')
        _GenericGameGUI(capture_tab, easy.capture_solution)
        # setup versus
        versus_tab = ttk.Frame(notebook)
        notebook.add(versus_tab, text='Versus')
        _GenericGameGUI(versus_tab, easy.versus_summaries)
        # done
        notebook.pack()
        self._root.mainloop()


class _GenericGameGUI(object):
{'fraction_non_alphanumeric': 0.0903586399627387, 'fraction_numerical': 0.0009315323707498836, 'mean_word_length': 3.107074569789675, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '567530', 'n_tokens_mistral': 666, 'n_tokens_neox': 651, 'n_words': 184}