<commit_before>import sys
from Bio import SeqIO

recs = [ (rec.name, len(rec.seq)) for rec in SeqIO.parse(open(sys.argv[1]), "fasta")]

SEGMENT_LENGTH = 50000
OVERLAP_LENGTH = 200

for name, length in recs:
    n_segments = (length / SEGMENT_LENGTH) + 1

    for n in xrange(0, length, SEGMENT_LENGTH):
        if ( n + SEGMENT_LENGTH) > length:
            print "%s:%d-%d" % (name, n, length - 1)
        else:
            print "%s:%d-%d" % (name, n, n + SEGMENT_LENGTH + OVERLAP_LENGTH)<commit_msg>use print() functions for python3 compatibility<commit_after>import sys
from Bio import SeqIO

recs = [ (rec.name, len(rec.seq)) for rec in SeqIO.parse(open(sys.argv[1]), "fasta")]

SEGMENT_LENGTH = 50000
OVERLAP_LENGTH = 200

for name, length in recs:
    n_segments = (length / SEGMENT_LENGTH) + 1

    for n in xrange(0, length, SEGMENT_LENGTH):
        if ( n + SEGMENT_LENGTH) > length:
            print("%s:%d-%d" % (name, n, length - 1))
        else:
            print("%s:%d-%d" % (name, n, n + SEGMENT_LENGTH + OVERLAP_LENGTH))
{'fraction_non_alphanumeric': 0.1423076923076923, 'fraction_numerical': 0.02403846153846154, 'mean_word_length': 3.0984251968503935, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3494548', 'n_tokens_mistral': 408, 'n_tokens_neox': 382, 'n_words': 104}