<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: <NAME> <vargash1>
# @Date:   Monday, April 11th 2016, 12:10:05 am
# @Email:  <EMAIL>
# @Last modified by:   vargash1
# @Last modified time: Monday, April 11th 2016, 12:48:03 am
import grovepi
import time
import sys

class LightSensor:

    def __init__(self):
        # GrovePi Analog Port
        self.port = 1
        self.threshold = 10

    def detect_light(self):
        while True:
            try:
                val = grovepi.analogRead(self.port)
                resistance = float(1023 - val) * 10 / val
                if resistance > self.threshold:
                    print "Low Light Levels"
                else:
                    print "High Light Levels"
                print "sensor val: {} resistance: {}".format(val, resistance)
                sys.stdout.flush()
                time.sleep(3)
            except IOError:
                pass
<commit_msg>Flush stdout<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: <NAME> <vargash1>
# @Date:   Monday, April 11th 2016, 12:10:05 am
# @Email:  <EMAIL>
# @Last modified by:   vargash1
# @Last modified time: Monday, April 11th 2016, 1:05:38 am
import grovepi
import time
import sys

class LightSensor:

    def __init__(self):
        # GrovePi Analog Port
        self.port = 1
        self.threshold = 10

    def detect_light(self):
        while True:
            try:
                time.sleep(6)
                val = grovepi.analogRead(self.port)
                resistance = float(1023 - val) * 10 / val
                if resistance > self.threshold:
                    print "Low Light Levels"
                else:
                    print "High Light Levels"
                print "sensor val: {} resistance: {}".format(val, resistance)
                sys.stdout.flush()

            except IOError:
                pass

{'fraction_non_alphanumeric': 0.10393700787401575, 'fraction_numerical': 0.03832020997375328, 'mean_word_length': 1.650904033379694, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '2590451', 'n_tokens_mistral': 628, 'n_tokens_neox': 541, 'n_words': 163}