<commit_before>#!/usr/local/bin/python

import Image
import autopy
import os

pX = 170
pY = 150
size = 50
span = 56

def draw_box(im, a, b):
    for i in range(size):
        for j in range(size):
            im.putpixel ((a + j, b + i), (0, 0, 0))

def screen_data():
    os.system("mkdir -p tmp")
    os.system("screencapture tmp/sc.png")
    im = Image.open("tmp/sc.png")
    for i in range(8):
        for j in range(8):
            draw_box(im, pX + j * span, pY + i * span)
    im.show()

screen_data()
<commit_msg>Impl take board data<commit_after>#!/usr/local/bin/python

import Image
import autopy
import os
import time

pX, pY = 180, 225
size, span = 30, 56

boxs = size * size

def draw_box(im, x, y):
    for i in range(size):
        for j in range(size):
            im.putpixel ((x + j, y + i), (0, 0, 0))

def take_box(im, x, y):
    R, G, B = 0, 0, 0
    for i in range(size):
        for j in range(size):
            r, g, b = im.getpixel ((x + j, y + i))
            R, G, B = R + r, G + g, B + b
    R, G, B = R / boxs, G / boxs, B / boxs
    if G - B > 10:
        return 0
    elif B > 200:
        return 3
    elif B > 105:
        return 4
    elif R > 53:
        return 2
    else:
        return 1

def screen_data():
    os.system("mkdir -p tmp")
    os.system("screencapture tmp/sc.png")
    im = Image.open("tmp/sc.png")
    for i in range(8):
        for j in range(8):
            p = take_box(im, pX + j * span, pY + i * span)
            print p, " ",
        print ""

screen_data()

{'fraction_non_alphanumeric': 0.14539473684210527, 'fraction_numerical': 0.031578947368421054, 'mean_word_length': 1.8324022346368716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2151539', 'n_tokens_mistral': 630, 'n_tokens_neox': 583, 'n_words': 201}