<commit_before><commit_msg>Add an example script that turns all PNGs upside down.<commit_after>import Image, cStringIO
def response(context, flow):
    if flow.response.headers["content-type"] == ["image/png"]:
        s = cStringIO.StringIO(flow.response.content)
        img = Image.open(s)
        img = img.rotate(180)
        s2 = cStringIO.StringIO()
        img.save(s2, "png")
        flow.response.content = s2.getvalue()

{'fraction_non_alphanumeric': 0.13225058004640372, 'fraction_numerical': 0.013921113689095127, 'mean_word_length': 3.1538461538461537, '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': '2239924', 'n_tokens_mistral': 140, 'n_tokens_neox': 135, 'n_words': 30}