<commit_before>
class TextProgress:
    
    def __init__(self):
        
        self.nstep=0
        self.text=None
        self.oldprogress=0
        self.progress=0
        
    def initialize(self,nstep,text=None):
        
        self.nstep=float(nstep)
        self.text=text
        
    def update(self,step,newtext=None):
        
        self.progress=int(float(step)/self.nstep*100)
        #print step,self.nstep
        
        if(self.progress/10==self.oldprogress/10+1): #just went through an interval of ten, ie. from 39 to 41, so update
            
            str="["
            for i in range(self.progress/10):
                str+="="
            for i in range(self.progress/10,10):
                str+="-"
                
            str+="]"
            
            print str
            
        self.oldprogress=self.progress
        return
<commit_msg>In the hope of minor speedups I: (1) removed newtext in the arguments (not used) (2) removed the brackets in an if statement (unnecessary) (3) removed a float conversion as one of the numbers in the expression is already a float<commit_after>
class TextProgress:
    
    def __init__(self):
        
        self.nstep=0
        self.text=None
        self.oldprogress=0
        self.progress=0
        
    def initialize(self,nstep,text=None):
        
        self.nstep=float(nstep)
        self.text=text
        
    def update(self,step):
        
        self.progress = int(step/self.nstep*100)
        #print step,self.nstep
        
        if self.progress/10==self.oldprogress/10+1: #just went through an interval of ten, ie. from 39 to 41, so update
            
            str="["
            for i in range(self.progress/10):
                str+="="
            for i in range(self.progress/10,10):
                str+="-"
                
            str+="]"
            
            print str
            
        self.oldprogress=self.progress
        return

{'fraction_non_alphanumeric': 0.09593908629441625, 'fraction_numerical': 0.02284263959390863, 'mean_word_length': 1.46375, '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': '6938218', 'n_tokens_mistral': 587, 'n_tokens_neox': 556, 'n_words': 140}