<commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import

# Three-way fallback for OrderedDict
try:
    from collections import OrderedDict
except ImportError:
    try:
        from astropy.utils.compat.odict import OrderedDict
    except ImportError:
        from ._odict_compat import OrderedDict

import collections

try:
    from weakref import WeakSet
except ImportError:
    from .utils._weakrefset import WeakSet

__all__ = ['OrderedDict', 'WeakSet', 'WeakOrderedSet']

#TODO: Need a python2.6 implementation of WeakSet

class OrderedSet(collections.MutableSet):
    def __init__(self, values=()):
        self._od = OrderedDict().fromkeys(values)
    def __len__(self):
        return len(self._od)
    def __iter__(self):
        return iter(self._od)
    def __contains__(self, value):
        return value in self._od
    def add(self, value):
        self._od[value] = None
    def discard(self, value):
        self._od.pop(value, None)

class WeakOrderedSet(WeakSet, object):
    """An ordered implementation of WeakSet"""
    def __init__(self, values=()):
        super(WeakOrderedSet, self).__init__()
        self.data = OrderedSet()
        for elem in values: # pragma: no cover
            self.add(elem)
        <commit_msg>Fix import warning from Astropy odict compatibility shim<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import

# Three-way fallback for OrderedDict
try:
    from collections import OrderedDict
except ImportError:
    # Suppress the astropy deprecation warning
    # emitted on import of this module.
    import warnings
    try:
        with warnings.catch_warnings():
            warnings.simplefilter("ignore")
            from astropy.utils.compat.odict import OrderedDict
    except ImportError:
        from ._odict_compat import OrderedDict

import collections

try:
    from weakref import WeakSet
except ImportError:
    from .utils._weakrefset import WeakSet

__all__ = ['OrderedDict', 'WeakSet', 'WeakOrderedSet']

#TODO: Need a python2.6 implementation of WeakSet

class OrderedSet(collections.MutableSet):
    def __init__(self, values=()):
        self._od = OrderedDict().fromkeys(values)
    def __len__(self):
        return len(self._od)
    def __iter__(self):
        return iter(self._od)
    def __contains__(self, value):
        return value in self._od
    def add(self, value):
        self._od[value] = None
    def discard(self, value):
        self._od.pop(value, None)

class WeakOrderedSet(WeakSet, object):
    """An ordered implementation of WeakSet"""
    def __init__(self, values=()):
        super(WeakOrderedSet, self).__init__()
        self.data = OrderedSet()
        for elem in values: # pragma: no cover
            self.add(elem)
        
{'fraction_non_alphanumeric': 0.09451659451659451, 'fraction_numerical': 0.0021645021645021645, 'mean_word_length': 3.0719530102790014, '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': '3696089', 'n_tokens_mistral': 833, 'n_tokens_neox': 809, 'n_words': 239}