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

import RPi.GPIO as GPIO
from time import sleep
from random import randint

pins = [5, 22, 27, 17, 12, 25, 23, 18]
pins.reverse()
GPIO.setmode(GPIO.BCM)
GPIO.setup(pins, GPIO.OUT)

def display(character):
    assert type(character) == type(str())
    assert len(character) == 1
    for p in pins:
        GPIO.output(p, GPIO.LOW) # reset the many
    for bit in range(8): # turn on the few
        if (ord(character) >> bit) % 2:
            GPIO.output(pins[bit], GPIO.HIGH)

for c in "Hello, world!":
    display(c)
    sleep(1)

GPIO.cleanup()<commit_msg>Reading and displaying any text from STDIN.<commit_after>#!/usr/bin/env python

import RPi.GPIO as GPIO
from time import sleep
import sys

pins = [5, 22, 27, 17, 12, 25, 23, 18]
pins.reverse()
GPIO.setmode(GPIO.BCM)
GPIO.setup(pins, GPIO.OUT)

pipe_contents = sys.stdin.read()

def display(character):
    assert type(character) == type(str())
    assert len(character) == 1
    for p in pins:
        GPIO.output(p, GPIO.LOW) # reset the many
    for bit in range(8): # turn on the few
        if (ord(character) >> bit) % 2:
            GPIO.output(pins[bit], GPIO.HIGH)

for c in pipe_contents:
    display(c)
    sleep(1)

GPIO.cleanup()
{'fraction_non_alphanumeric': 0.13754045307443366, 'fraction_numerical': 0.030744336569579287, 'mean_word_length': 3.164983164983165, 'pattern_counts': {'":': 1, '<': 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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1703473', 'n_tokens_mistral': 475, 'n_tokens_neox': 430, 'n_words': 136}