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

# Script to separate raw 3D video files
# that have both images in the same file
# (e.g, frame1Left, frame1Right, frame2Left, frame2Right)
#
# Separates these frames in 2 files
# Left: frame1, frame2
# Right: frame1, frame2
#
# Usage: ./separate_3d.py input_file out_L out_R
#
# Currently, the image size in bytes is hardcoded in nbBytes

import sys

# Set the number of bytes per frame here
nbBytes = 1920*1080*2

if len(sys.argv) < 4:
    print ("oh oh, should be: %s in out_L out_R")%(sys.argv[0])
    exit(0)

in_fn = sys.argv[1] 
outL_fn = sys.argv[2]
outR_fn = sys.argv[3]

print ("From %s, to %s, %s")%(in_fn, outL_fn, outR_fn)

with open(in_fn, 'rb') as in_f:
    with open(outL_fn, 'wb') as outL_f:
        with open(outR_fn, 'wb') as outR_f:
            frameL = in_f.read(nbBytes)
            frameR = in_f.read(nbBytes)
            while frameL and frameR:
                outL_f.write(frameL)
                outR_f.write(frameR)
                frameL = in_f.read(nbBytes)
                frameR = in_f.read(nbBytes)<commit_msg>Remove unnecessary space in separate_3d.py<commit_after>#!/usr/bin/env python

# Script to separate raw 3D video files
# that have both images in the same file
# (e.g, frame1Left, frame1Right, frame2Left, frame2Right)
#
# Separates these frames in 2 files
# Left: frame1, frame2
# Right: frame1, frame2
#
# Usage: ./separate_3d.py input_file out_L out_R
#
# Currently, the image size in bytes is hardcoded in nbBytes

import sys

# Set the number of bytes per frame here
nbBytes = 1920*1080*2

if len(sys.argv) < 4:
    print ("oh oh, should be: %s in out_L out_R")%(sys.argv[0])
    exit(0)

in_fn = sys.argv[1]
outL_fn = sys.argv[2]
outR_fn = sys.argv[3]

print ("From %s, to %s, %s")%(in_fn, outL_fn, outR_fn)

with open(in_fn, 'rb') as in_f:
    with open(outL_fn, 'wb') as outL_f:
        with open(outR_fn, 'wb') as outR_f:
            frameL = in_f.read(nbBytes)
            frameR = in_f.read(nbBytes)
            while frameL and frameR:
                outL_f.write(frameL)
                outR_f.write(frameR)
                frameL = in_f.read(nbBytes)
                frameR = in_f.read(nbBytes)
{'fraction_non_alphanumeric': 0.1156307129798903, 'fraction_numerical': 0.024223034734917732, 'mean_word_length': 2.8336252189141855, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1974876', 'n_tokens_mistral': 869, 'n_tokens_neox': 829, 'n_words': 237}