<commit_before>"""A factory for unique sentinel values.

`Sentinel` objects are unique in the sense that they are equal only to
themselves. `Sentinel` objects can not be pickled.

Written by <NAME>
"""

from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import

import inspect
import six


def create(name, description=''):
    """Creates a new sentinel
    """
    if description == '':
        description = "Sentinel '%s'" % name

    class Sentinel(object):  # pylint: disable=too-few-public-methods
        """Sentinel class
        """
        def __init__(self):
            """Initializer
            """
            if six.PY2:
                self.name = name.encode()
            elif six.PY3:
                self.name = name
            else:
                raise RuntimeError("Python version not supported...")
            self.__name__ = self.name
            self.__class__.__name__ = self.name<commit_msg>Simplify pyexperiment.utils.sentinel<commit_after>"""A factory for unique sentinel values.

`Sentinel` objects are unique in the sense that they are equal only to
themselves. `Sentinel` objects can not be pickled.

Written by <NAME>
"""

from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import

import inspect


def create(name, description=''):
    """Creates a new sentinel
    """
    if description == '':
        description = "Sentinel '%s'" % name

    class Sentinel(object):  # pylint: disable=too-few-public-methods
        """Sentinel class
        """
        def __init__(self):
            """Initializer
            """
            self.name = str(name)
            self.__name__ = self.name
            self.__class__.__name__ = self.name
{'fraction_non_alphanumeric': 0.09296077377753896, 'fraction_numerical': 0.0010746910263299302, 'mean_word_length': 2.5399239543726235, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5913065', 'n_tokens_mistral': 528, 'n_tokens_neox': 490, 'n_words': 164}