<commit_before>#!/usr/bin/python
#
# Program to generate profiling data.  Run with one argument,
# the profile stats file to generate.

import sys
import os

# Change path so we find Xlib
sys.path.insert(1, os.path.join(sys.path[0], '..'))

from Xlib import X, display, Xatom

import profile

def dostuff():
    d = display.Display()
    r = d.screen().root
    cm = d.screen().default_colormap

    for i in xrange(0, 1000):
        if i % 50 == 0:
            print 'Iteration', i

        r.delete_property(Xatom.WM_NORMAL_HINTS)
        r.delete_property(Xatom.WM_NORMAL_HINTS)
        r.get_geometry()
        r.get_geometry()
        r.delete_property(Xatom.WM_NORMAL_HINTS)
        r.delete_property(Xatom.WM_NORMAL_HINTS)
        r.change_property(Xatom.WM_NORMAL_HINTS, Xatom.STRING, 32, [1, 2, 3, 4])
        r.query_tree()
        cm.query_colors([0, 1, 2, 3, 4, 5, 6, 7])

def main():
    profile.run('dostuff()', sys.argv[1])

if __name__ == '__main__':
    main()
<commit_msg>tiny bit of help text<commit_after>#!/usr/bin/python
#
# Program to generate profiling data.  Run with one argument,
# the profile stats file to generate.

import sys
import os

# Change path so we find Xlib
sys.path.insert(1, os.path.join(sys.path[0], '..'))

from Xlib import X, display, Xatom

import profile

def dostuff():
    d = display.Display()
    r = d.screen().root
    cm = d.screen().default_colormap

    for i in xrange(0, 1000):
        if i % 50 == 0:
            print 'Iteration', i

        r.delete_property(Xatom.WM_NORMAL_HINTS)
        r.delete_property(Xatom.WM_NORMAL_HINTS)
        r.get_geometry()
        r.get_geometry()
        r.delete_property(Xatom.WM_NORMAL_HINTS)
        r.delete_property(Xatom.WM_NORMAL_HINTS)
        r.change_property(Xatom.WM_NORMAL_HINTS, Xatom.STRING, 32, [1, 2, 3, 4])
        r.query_tree()
        cm.query_colors([0, 1, 2, 3, 4, 5, 6, 7])

def main(filename):
    profile.run('dostuff()', filename)

if __name__ == '__main__':
    if len(sys.argv) == 2:
        main(sys.argv[1])
    else:
        print sys.argv[0], "<filename to write profile output to>"

{'fraction_non_alphanumeric': 0.13304924242424243, 'fraction_numerical': 0.02462121212121212, 'mean_word_length': 2.8140794223826715, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '5069755', 'n_tokens_mistral': 811, 'n_tokens_neox': 773, 'n_words': 188}