<commit_before>"""Convert :term:`BSML` format to :term:`TXT` formats"""
from biokit.converters.convbase import ConvBase
from libsbml import *

class Bsml2Txt(ConvBase):
    """
    """
    def __init__(self, infile, outfile, *args, **kargs):
        """.. rubric:: constructor
        :param str filename
        """
        self.infile = infile
        self.outfile = outfile
        
        super(Bsml2Txt, self).__init__(infile, outfile, *args, **kargs)

    def __call__(self):
        
        output_handle = open(self.outfile, "w")
        
        AlignIO.write(writeSBMLToString(SBMLReader(self.infile)), output_handle, "txt")
        
        output_handle.close()<commit_msg>Update Bsml2Txt.py<commit_after>"""Convert :term:`BSML` format to :term:`TXT` formats"""
from biokit.converters.convbase import ConvBase
from libsbml import *

class Bsml2Txt(ConvBase):
    
    """
    """
    input_ext = ['bsml']
    output_ext = '.txt'

    def __init__(self, infile, outfile):
        """.. rubric:: constructor
        :param str filename
        """
        self.infile = infile
        self.outfile = outfile
        
        super(Bsml2Txt, self).__init__(infile, outfile)
        
    def __call__(self):
        
        with open(self.outfile, "w") as output_handle:
        
            output_handle.write(writeSBMLToString(SBMLReader(self.infile)))
{'fraction_non_alphanumeric': 0.1281112737920937, 'fraction_numerical': 0.0036603221083455345, 'mean_word_length': 2.5231958762886597, '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': '5369143', 'n_tokens_mistral': 449, 'n_tokens_neox': 441, 'n_words': 87}