<commit_before>import datetime
import requests

import picamera

import serial

import time

camera = picamera.PiCamera()
camera.resolution = (1900, 1200)
camera.awb_mode = 'fluorescent'
camera.framerate = 0.5
# Wait for the automatic gain control to settle
time.sleep(5)
# Now fix the values
camera.shutter_speed = camera.exposure_speed
camera.exposure_mode = 'off'
g = camera.awb_gains
camera.awb_mode = 'off'
camera.awb_gains = g


def capture(session_name, state):
    r = requests.get('http://digitalfoodone.appspot.com/macrocontrolrequest')
    data = r.json()
    upload_url = data['upload_url']

    camera.capture('my_img.jpg')
    time.sleep(1)
    files = {'file':open('my_img.jpg','rb')}
    resp = requests.post(upload_url, files=files, data={'session_name':session_name,'state':state})
    return resp<commit_msg>macrosession script<commit_after>import datetime
import requests

import picamera

import serial

import time

camera = picamera.PiCamera()
camera.resolution = (1900, 1200)
camera.awb_mode = 'fluorescent'
camera.framerate = 5
# Wait for the automatic gain control to settle
time.sleep(5)
# Now fix the values
camera.shutter_speed = camera.exposure_speed
camera.exposure_mode = 'off'
g = camera.awb_gains
camera.awb_mode = 'off'
camera.awb_gains = g


def capture(session_name, state):
    r = requests.get('http://digitalfoodone.appspot.com/macrocontrolrequest')
    data = r.json()
    upload_url = data['upload_url']

    camera.capture('my_img.jpg')
    time.sleep(1)
    files = {'file':open('my_img.jpg','rb')}
    resp = requests.post(upload_url, files=files, data={'session_name':session_name,'state':state})
    return resp
{'fraction_non_alphanumeric': 0.12484921592279856, 'fraction_numerical': 0.013872135102533172, 'mean_word_length': 4.946236559139785, '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': '4467120', 'n_tokens_mistral': 584, 'n_tokens_neox': 549, 'n_words': 122}