<commit_before>#!/usr/bin/env python
# Simple websocket server that collects data from four accelerometers
import sys
import asyncio
import json
import websockets
import netifaces
from collections import OrderedDict
from datetime import datetime
import Adafruit_GPIO.SPI as SPI
import Adafruit_MCP3008

EPOCH = datetime.utcfromtimestamp(0)

SAMPLE_INTERVAL = 1 / 60 # sec

WEBSOCKET_PORT = 5678

# GPIO config
mcp0 = Adafruit_MCP3008.MCP3008(spi=SPI.SpiDev(0, 0))
mcp1 = Adafruit_MCP3008.MCP3008(spi=SPI.SpiDev(0, 1))

# Conf
LEFT_HAND = {
    'channel': 1,
    'x_pin': 0,
    'y_pin': 1,
    'z_pin': 2 
}

RIGHT_HAND = {
    'channel': 1,
    'x_pin': 5,
    'y_pin': 6,
    'z_pin': 7 
}

LEFT_LEG = {
    'channel': 0,
    'x_pin': 0,
    'y_pin': 1,
    'z_pin': 2 
}

RIGHT_LEG = {
    'channel': 0,
    'x_pin': 5,
    'y_pin': 6,
    'z_pin': 7 
}


def readadc(pin):
    return mcp.read_adc(pin)

class Collector():<commit_msg>Clean up collector script<commit_after>#!/usr/bin/env python
# Simple websocket server that collects data from four accelerometers
import sys
import asyncio
import json
import websockets
import netifaces
from collections import OrderedDict
from datetime import datetime
import Adafruit_GPIO.SPI as SPI
import Adafruit_MCP3008

SAMPLE_INTERVAL = 1 / 60 # sec

WEBSOCKET_PORT = 5678

# Spi config
mcp0 = Adafruit_MCP3008.MCP3008(spi=SPI.SpiDev(0, 0))
mcp1 = Adafruit_MCP3008.MCP3008(spi=SPI.SpiDev(0, 1))

LEFT_HAND = {
    'channel': 1,
    'x_pin': 0,
    'y_pin': 1,
    'z_pin': 2 
}

RIGHT_HAND = {
    'channel': 1,
    'x_pin': 5,
    'y_pin': 6,
    'z_pin': 7 
}

LEFT_LEG = {
    'channel': 0,
    'x_pin': 0,
    'y_pin': 1,
    'z_pin': 2 
}

RIGHT_LEG = {
    'channel': 0,
    'x_pin': 5,
    'y_pin': 6,
    'z_pin': 7 
}


class Collector():
{'fraction_non_alphanumeric': 0.12667410714285715, 'fraction_numerical': 0.05524553571428571, 'mean_word_length': 3.4271604938271607, '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': '468221', 'n_tokens_mistral': 834, 'n_tokens_neox': 740, 'n_words': 183}