<commit_before>import re
import ROOT
from rootpy.basictypes import *
from rootpy.classfactory import *
from rootpy.core import *
from rootpy.utils import *
from rootpy.registry import *
from rootpy.io import *
from rootpy.filtering import *
from rootpy.plotting import *

class Tree(Plottable, Object, ROOT.TTree):
    """
    Inherits from TTree so all regular TTree methods are available
    but Draw has been overridden to improve usage in Python
    """
    draw_command = re.compile('^.+>>[\+]?(?P<name>[^(]+).*$')

    def __init__(self, buffer = None, variables = None, name = None, title = None):

        Object.__init__(self, name, title)
        if buffer != None:
            if variables == None:
                variables = buffer.keys()
            for variable in variables:
                value = buffer[variable]
                if isinstance(value, Variable):
                    self.Branch(variable, value, "%s/%s"% (name, value.type()))
                elif isinstance(value, ROOT.vector):
                    self.Branch(variable, value)
                else:
                    raise TypeError("type %s for branch %s is not valid"% (type(value), variable))
    
    def __getitem__(self, branch):
        
        branch = self.GetBranch(branch)
        if branch:
            return branch.GetAddress()
        raise KeyError("'%s'"% branch)
     
    def __iter__(self):

        i = 0
        while self.GetEntry(i):
            yield self
            i += 1
    
    def Scale(self, value):
<commit_msg>updates<commit_after>import re
import ROOT
from rootpy.basictypes import *
from rootpy.classfactory import *
from rootpy.core import *
from rootpy.utils import *
from rootpy.registry import *
from rootpy.io import *
from rootpy.filtering import *
from rootpy.plotting import *

class Tree(Plottable, Object, ROOT.TTree):
    """
    Inherits from TTree so all regular TTree methods are available
    but Draw has been overridden to improve usage in Python
    """
    draw_command = re.compile('^.+>>[\+]?(?P<name>[^(]+).*$')

    def __init__(self, buffer = None, variables = None, name = None, title = None):

        Object.__init__(self, name, title)
        if buffer != None:
            if variables == None:
                variables = buffer.keys()
            for variable in variables:
                value = buffer[variable]
                if isinstance(value, Variable):
                    self.Branch(variable, value, "%s/%s"% (name, value.type()))
                elif isinstance(value, ROOT.vector):
                    self.Branch(variable, value)
                else:
                    raise TypeError("type %s for branch %s is not valid"% (type(value), variable))
    
    def __getitem__(self, branch):
        
        branch = self.GetBranch(branch)
        if branch:
            return getattr(self, branch)
        raise KeyError("'%s'"% branch)
     
    def __iter__(self):

        i = 0
        while self.GetEntry(i):
            yield self
            i += 1
    
    def Scale(self, value):

{'fraction_non_alphanumeric': 0.10907903331156107, 'fraction_numerical': 0.0013063357282821686, 'mean_word_length': 2.078391959798995, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '3045889', 'n_tokens_mistral': 872, 'n_tokens_neox': 843, 'n_words': 263}