<commit_before>'''The script reads sequences in fasta format and selects sequences that are
longer than a user specified length.

'''

import sys
from Bio import SeqIO

def main():
    try:
        fasta_file = sys.argv[1]
        size = int(sys.argv[2])
    except IndexError:
        print >> sys.stderr, 'size_select.py <fasta file> <size>'

    for record in SeqIO.parse(fasta_file, 'fasta'):
        if len(record) >= size:
            print >> sys.stderr, 'Writing %s ..' % (record.id)
            SeqIO.write(record, fasta_file, sys.stdout, 'fasta')


if __name__=='__main__':
    main()<commit_msg>fixed error in writing sequences to stdout<commit_after>'''The script reads sequences in fasta format and selects sequences that are
longer than a user specified length.

'''

import sys
from Bio import SeqIO

def main():
    try:
        fasta_file = sys.argv[1]
        size = int(sys.argv[2])
    except IndexError:
        print >> sys.stderr, 'size_select.py <fasta file> <size>'

    for record in SeqIO.parse(fasta_file, 'fasta'):
        if len(record) >= size:
            print >> sys.stderr, 'Writing %s ..' % (record.id)
            SeqIO.write(record, sys.stdout, 'fasta')


if __name__=='__main__':
    main()
{'fraction_non_alphanumeric': 0.12449145646867373, 'fraction_numerical': 0.0032546786004882017, 'mean_word_length': 2.8679245283018866, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '4773710', 'n_tokens_mistral': 403, 'n_tokens_neox': 390, 'n_words': 122}