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

from argparse import ArgumentParser
import serial

def run(device, baud):
    with serial.Serial(device, baud, timeout=0.1) as ser:
        while True:
            line = ser.readline()
            if line:
                print line

if __name__ == '__main__':
    parser = ArgumentParser()
    parser.add_argument('device',
                        help='serial device, typically /dev/tty.usbserial-*')
    parser.add_argument('--baud', dest='baud', type=int, default=74880)
    args = parser.parse_args()
    run(args.device, args.baud)<commit_msg>Use sys.stdout.write to get rid of extra newlines<commit_after>#!/usr/bin/env python

from argparse import ArgumentParser
import sys
import serial

def run(device, baud):
    with serial.Serial(device, baud, timeout=0.1) as ser:
        while True:
            line = ser.readline()
            if line:
                sys.stdout.write(line)

if __name__ == '__main__':
    parser = ArgumentParser()
    parser.add_argument('device',
                        help='serial device, typically /dev/tty.usbserial-*')
    parser.add_argument('--baud', dest='baud', type=int, default=74880)
    args = parser.parse_args()
    run(args.device, args.baud)
{'fraction_non_alphanumeric': 0.12307692307692308, 'fraction_numerical': 0.011336032388663968, 'mean_word_length': 2.6676557863501484, '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': '7272882', 'n_tokens_mistral': 388, 'n_tokens_neox': 376, 'n_words': 93}