<commit_before>#Py3k compat
try:
	a = basestring
	del a
except NameError:
	basestring = str

class PropDict(dict):
    def __init__(self, srcs):
        dict.__init__(self)
        self._sources = srcs

    def set_source_preference(self, sources):
        """
        Change list of source preference
        This method has been deprecated and should no longer be used.
        """
        raise DeprecationWarning("This method has been deprecated and should no longer be used. Set the sources list using the 'sources' property.")
        self._set_sources(sources)

    def has_key(self, item):
        try:
            self.__getitem__(item)
            return True
        except KeyError:
            return False

    def __contains__(self, item):
        return self.has_key(item)

    def __getitem__(self, item):
        if isinstance(item, basestring):
            for src in self._sources:
                if src.endswith('*'):
                    for k,v in self.iteritems():
                        if k[0].startswith(src[:-1]) and k[1] == item:
                            return v
                try:
                    t = dict.__getitem__(self, (src, item))
                    return t
                except KeyError:
                    pass
            raise KeyError(item)
        return dict.__getitem__(self, item)

    def get(self, item, default=None):
        try:<commit_msg>OTHER: Fix python3 compat issue in propdict<commit_after>#Py3k compat
try:
	a = basestring
	del a
except NameError:
	basestring = str

class PropDict(dict):
    def __init__(self, srcs):
        dict.__init__(self)
        self._sources = srcs

    def set_source_preference(self, sources):
        """
        Change list of source preference
        This method has been deprecated and should no longer be used.
        """
        raise DeprecationWarning("This method has been deprecated and should no longer be used. Set the sources list using the 'sources' property.")
        self._set_sources(sources)

    def has_key(self, item):
        try:
            self.__getitem__(item)
            return True
        except KeyError:
            return False

    def __contains__(self, item):
        return self.has_key(item)

    def __getitem__(self, item):
        if isinstance(item, basestring):
            for src in self._sources:
                if src.endswith('*'):
                    for k in self:
                        if k[0].startswith(src[:-1]) and k[1] == item:
                            return dict.__getitem__(self, k)
                try:
                    t = dict.__getitem__(self, (src, item))
                    return t
                except KeyError:
                    pass
            raise KeyError(item)
        return dict.__getitem__(self, item)

    def get(self, item, default=None):
        try:
{'fraction_non_alphanumeric': 0.08239831697054699, 'fraction_numerical': 0.003155680224403927, 'mean_word_length': 1.7017045454545454, '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': '5891483', 'n_tokens_mistral': 780, 'n_tokens_neox': 746, 'n_words': 242}