<commit_before>"""
    ulid/ulid
    ~~~~~~~~~

    Object representation of a ULID.
"""
import datetime
import uuid

from . import base32


__all__ = ['Timestamp', 'Randomness', 'ULID']


class MemoryView:
    """
    Wraps a buffer object, typically :class:`~bytes`, with a :class:`~memoryview` and provides easy
    type comparisons and conversions between presentation formats.
    """

    __slots__ = ['memory']

    def __init__(self, buffer):
        self.memory = memoryview(buffer)

    def __eq__(self, other):
        if isinstance(other, MemoryView):
            return self.memory == other.memory
        if isinstance(other, (bytes, bytearray, memoryview)):
            return self.memory == other
        if isinstance(other, int):
            return self.int == other
        if isinstance(other, str):
            return self.str == other
        return NotImplemented

    def __ne__(self, other):
        if isinstance(other, MemoryView):
            return self.memory != other.memory
        if isinstance(other, (bytes, bytearray, memoryview)):
            return self.memory != other
        if isinstance(other, int):
            return self.int != other
        if isinstance(other, str):
            return self.str != other
        return NotImplemented

    def __lt__(self, other):
        if isinstance(other, MemoryView):
            return self.memory < other.memory
        if isinstance(other, (bytes, bytearray, memoryview)):
            return self.memory < other
        if isinstance(other, int):
            return self.int < other
        if isinstance(other, str):
            return self.str < other
        return NotImplemented

    def __gt__(self, other):
        if isinstance(other, MemoryView):
            return self.memory > other.memory
        if isinstance(other, (bytes, bytearray, memoryview)):
            return self.memory > other
        if isinstance(other, int):
            return self.int > other
        if isinstance(other, str):
            return self.str > other
        return NotImplemented

    def __le__(self, other):
        if isinstance(other, MemoryView):
            return self.memory <= other.memory
        if isinstance(other, (bytes, bytearray, memoryview)):
            return self.memory <= other
        if isinstance(other, int):
            return self.int <= other
        if isinstance(other, str):
            return self.str <= other
        return NotImplemented

    def __ge__(self, other):
        if isinstance(other, MemoryView):
            return self.memory >= other.memory
        if isinstance(other, (bytes, bytearray, memoryview)):
            return self.memory >= other
        if isinstance(other, int):
            return self.int >= other
        if isinstance(other, str):
            return self.str >= other
        return NotImplemented<commit_msg>Refactor MemoryView ordering rules to use int value.<commit_after>"""
    ulid/ulid
    ~~~~~~~~~

    Object representation of a ULID.
"""
import datetime
import uuid

from . import base32


__all__ = ['Timestamp', 'Randomness', 'ULID']


class MemoryView:
    """
    Wraps a buffer object, typically :class:`~bytes`, with a :class:`~memoryview` and provides easy
    type comparisons and conversions between presentation formats.
    """

    __slots__ = ['memory']

    def __init__(self, buffer):
        self.memory = memoryview(buffer)

    def __eq__(self, other):
        if isinstance(other, MemoryView):
            return self.memory == other.memory
        if isinstance(other, (bytes, bytearray, memoryview)):
            return self.memory == other
        if isinstance(other, int):
            return self.int == other
        if isinstance(other, str):
            return self.str == other
        return NotImplemented

    def __ne__(self, other):
        if isinstance(other, MemoryView):
            return self.memory != other.memory
        if isinstance(other, (bytes, bytearray, memoryview)):
            return self.memory != other
        if isinstance(other, int):
            return self.int != other
        if isinstance(other, str):
            return self.str != other
        return NotImplemented

    def __lt__(self, other):
        if isinstance(other, MemoryView):
            return self.int < other.int
        if isinstance(other, (bytes, bytearray, memoryview)):
            return self.int < int.from_bytes(other, byteorder='big')
        if isinstance(other, int):
            return self.int < other
        if isinstance(other, str):  # TODO: #1
            return self.str < other
        return NotImplemented

    def __gt__(self, other):
        if isinstance(other, MemoryView):
            return self.int > other.int
        if isinstance(other, (bytes, bytearray, memoryview)):
            return self.int > int.from_bytes(other, byteorder='big')
        if isinstance(other, int):
            return self.int > other
        if isinstance(other, str):  # TODO: #1
            return self.str > other
        return NotImplemented

    def __le__(self, other):
        if isinstance(other, MemoryView):
            return self.int <= other.int
        if isinstance(other, (bytes, bytearray, memoryview)):
            return self.int <= int.from_bytes(other, byteorder='big')
        if isinstance(other, int):
            return self.int <= other
        if isinstance(other, str):  # TODO: #1
            return self.str <= other
        return NotImplemented

    def __ge__(self, other):
        if isinstance(other, MemoryView):
            return self.int >= other.int
        if isinstance(other, (bytes, bytearray, memoryview)):
            return self.int >= int.from_bytes(other, byteorder='big')
        if isinstance(other, int):
            return self.int >= other
        if isinstance(other, str):  # TODO: #1
            return self.str >= other
        return NotImplemented
{'fraction_non_alphanumeric': 0.1013022154574666, 'fraction_numerical': 0.0013529511246406223, 'mean_word_length': 2.19848566792861, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '4281067', 'n_tokens_mistral': 1524, 'n_tokens_neox': 1497, 'n_words': 482}