<commit_before># Simple python script for capturing webcam images from a raspberry PI
# Produces image files with the currrent sytem time as the file name
import os
import datetime
import requests
from subprocess import call

RPI_CONFIGS = [
    {
        'savename': 'rpi1',
        'resolution': '1392x768'
    },
    {
        'savename': 'rpi2',
        'resolution': '544x288'
    }
]
RPI_CONFIG = RPI_CONFIGS[0]
NSQ_HOST = 'http://127.0.0.1:4151'


def main():

    # publishes a new image to the new_images topic
    def publish_on_new_image(image_name):
        topic = 'new_image'
        headers = {'content-type': 'application/x-www-form-urlencoded'}
        requests.post('%s/put?topic=%s' % (NSQ_HOST, topic), data=image_name, headers=headers)

    def get_size(start_path='.'):
        total_size = 0
        for dirpath, dirnames, filenames in os.walk(start_path):
            for f in filenames:
                fp = os.path.join(dirpath, f)
                total_size += os.path.getsize(fp)
        return total_size

    if get_size('rendered/') > :
        call(['killall watch'], shell=True)<commit_msg>Forgot the disk writing threshold<commit_after># Simple python script for capturing webcam images from a raspberry PI
# Produces image files with the currrent sytem time as the file name
import os
import datetime
import requests
from subprocess import call

RPI_CONFIGS = [
    {
        'savename': 'rpi1',
        'resolution': '1392x768'
    },
    {
        'savename': 'rpi2',
        'resolution': '544x288'
    }
]
RPI_CONFIG = RPI_CONFIGS[0]
NSQ_HOST = 'http://127.0.0.1:4151'
MAX_DISK_SIZE = 12000000000  # black friday sales blessed me with an ample 16gb
                             # micro sd for each of these computing beasts

def main():

    # publishes a new image to the new_images topic
    def publish_on_new_image(image_name):
        topic = 'new_image'
        headers = {'content-type': 'application/x-www-form-urlencoded'}
        requests.post('%s/put?topic=%s' % (NSQ_HOST, topic), data=image_name, headers=headers)

    def get_size(start_path='.'):
        total_size = 0
        for dirpath, dirnames, filenames in os.walk(start_path):
            for f in filenames:
                fp = os.path.join(dirpath, f)
                total_size += os.path.getsize(fp)
        return total_size

    if get_size('rendered/') > MAX_DISK_SIZE:
        call(['killall watch'], shell=True)
{'fraction_non_alphanumeric': 0.10891903000411016, 'fraction_numerical': 0.027538018906699546, 'mean_word_length': 2.687878787878788, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 1, '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': '7163572', 'n_tokens_mistral': 841, 'n_tokens_neox': 772, 'n_words': 213}