<commit_before>#!/usr/bin/python3
# -*- coding: utf-8 -*-

'''
This code was inspired by the third python coding example on
http://picamera.readthedocs.io/en/release-1.10/recipes1.html#recording-to-a-network-stream
However, multiple customizations were applied and thus only the basic setup is
identical.

2017 Strahlenschutzkommando@Github
'''

import socket
import picamera

with picamera.PiCamera() as cam:
    cam.resolution = (640, 480)
    cam.framerate = 1/60

    server_socket = socket.socket()
    server_socket.bind(('0.0.0.0', 8000))
    server_socket.listen(0)

    # Accept exclusively one connection and convert stream to file-like object
    connection = server_socket.accept()[0].makefile('wb')
    try:
        cam.start_recording(connection, format='h264')
        cam.wait_recording(60)
        cam.stop_recording()
    finally:
        connection.close()
        server_socket.close()<commit_msg>Corrected typo @streamPiCam.py: @l.24: exclusively → exactly<commit_after>#!/usr/bin/python3
# -*- coding: utf-8 -*-

'''
This code was inspired by the third python coding example on
http://picamera.readthedocs.io/en/release-1.10/recipes1.html#recording-to-a-network-stream
However, multiple customizations were applied and thus only the basic setup is
identical.

2017 Strahlenschutzkommando@Github
'''

import socket
import picamera

with picamera.PiCamera() as cam:
    cam.resolution = (640, 480)
    cam.framerate = 1/60

    server_socket = socket.socket()
    server_socket.bind(('0.0.0.0', 8000))
    server_socket.listen(0)

    # Accept exactly one connection and convert stream to file-like object
    connection = server_socket.accept()[0].makefile('wb')
    try:
        cam.start_recording(connection, format='h264')
        cam.wait_recording(60)
        cam.stop_recording()
    finally:
        connection.close()
        server_socket.close()
{'fraction_non_alphanumeric': 0.11667554608417688, 'fraction_numerical': 0.03729355354288759, 'mean_word_length': 3.5916870415647923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '177350', 'n_tokens_mistral': 637, 'n_tokens_neox': 590, 'n_words': 141}