<commit_before>import json
import urllib
import codecs

from iepy.models import PreProcessSteps, Entity, EntityOccurrence
from iepy.ner import NERRunner
from iepy.preprocess import BasePreProcessStepRunner


class LitTagger:
    
    def __init__(self, labels, src_filenames):
        """The i-th label is used to tag the occurrences of the terms in the
        i-th source file. If a term can have several labels, the last one in the
        list is selected.
        """
        assert len(labels) == len(src_filenames)
        self.labels = labels
        self.src_filenames = src_filenames
    
        names = set()
        names_map = {}
        for label, filename in zip(labels, src_filenames):
            f = codecs.open(filename, encoding="utf8")
            namelist = f.read().strip().split('\n')
            names.update(namelist)<commit_msg>Made LitTagger explicitly support new style classes for python 2.7 compatibility<commit_after>import json
import urllib
import codecs

from iepy.models import PreProcessSteps, Entity, EntityOccurrence
from iepy.ner import NERRunner
from iepy.preprocess import BasePreProcessStepRunner


class LitTagger(object):
    
    def __init__(self, labels, src_filenames):
        """The i-th label is used to tag the occurrences of the terms in the
        i-th source file. If a term can have several labels, the last one in the
        list is selected.
        """
        assert len(labels) == len(src_filenames)
        self.labels = labels
        self.src_filenames = src_filenames
    
        names = set()
        names_map = {}
        for label, filename in zip(labels, src_filenames):
            f = codecs.open(filename, encoding="utf8")
            namelist = f.read().strip().split('\n')
            names.update(namelist)
{'fraction_non_alphanumeric': 0.0800223838836038, 'fraction_numerical': 0.002238388360380526, 'mean_word_length': 2.6942148760330578, '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': '3903467', 'n_tokens_mistral': 521, 'n_tokens_neox': 509, 'n_words': 169}