<commit_before>#!/usr/bin/python

# X-Uniform-Type-Identifier: com.apple.mail-note

import Tkinter, threading, Queue, time, os, ConfigParser

def run2(*args):
    f = q.get_nowait()
    f(None)
    pass

root = Tkinter.Tk()

w = Tkinter.Label(root, text="Hello, world!")
w.pack()
w.bind("<<foobar>>", run2)

b = Tkinter.Button(root, text="Ok")
b.pack()

l = Tkinter.Listbox(root)
l.pack()

def invokeLater(func):
    q.put(func)
    time.sleep(3)
    w.event_generate("<<foobar>>")

def run():
    b.config(text="wurst")
    invokeLater(lambda _: b.config(text="blabla"))
    pass

q = Queue.Queue()

t = threading.Thread(target=run)
t.start()<commit_msg>testtest<commit_after>#!/usr/bin/python

# X-Uniform-Type-Identifier: com.apple.mail-note

import Tkinter, threading, Queue, time, os, ConfigParser

def invokeLaterCallback(*args):
    func = eventQueue.get_nowait()
    func(None)

def invokeLater(func):
    eventQueue.put(func)
    root.event_generate("<<invokeLater>>")

def sendTestEvent():
    invokeLater(lambda _: root.title("foobar"))

root = Tkinter.Tk()
root.title("imapnotes")

frame1 = Tkinter.Frame(root)
frame1.pack(fill=Tkinter.BOTH, expand=1)

frame2 = Tkinter.Frame(frame1)
frame2.pack(side=Tkinter.LEFT)

button = Tkinter.Button(frame2, text="New")
button.pack(side=Tkinter.TOP, fill=Tkinter.X)

button = Tkinter.Button(frame2, text="Delete")
button.pack(side=Tkinter.TOP, fill=Tkinter.X)

panedWindow = Tkinter.PanedWindow(frame1, orient=Tkinter.HORIZONTAL)
panedWindow.pack(fill=Tkinter.BOTH, expand=1)

listbox = Tkinter.Listbox(panedWindow)
panedWindow.add(listbox)

text = Tkinter.Text(panedWindow)
panedWindow.add(text)

eventQueue = Queue.Queue()
root.bind("<<invokeLater>>", invokeLaterCallback)

threading.Timer(2, sendTestEvent).start()
{'fraction_non_alphanumeric': 0.16449971735443752, 'fraction_numerical': 0.00791407574901074, 'mean_word_length': 5.389891696750903, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '48202', 'n_tokens_mistral': 709, 'n_tokens_neox': 693, 'n_words': 107}