<commit_before>from unittest import TestCase
import sys

from testfixtures import Comparison as C, TempDirectory, compare, diff
from testfixtures.compat import PY2, PY3, exception_module
from testfixtures.shouldraise import ShouldAssert
from testfixtures.tests.sample1 import SampleClassA, a_function
import pytest


class AClass:

    def __init__(self, x, y=None):
        self.x = x
        if y:
            self.y = y

    def __repr__(self):
        return '<'+self.__class__.__name__+'>'


class BClass(AClass):
    pass


class WeirdException(Exception):
    def __init__(self, x, y):
        self.x = x
        self.y = y


class X(object):
    __slots__ = ['x']

    def __repr__(self):
        return '<X>'


class FussyDefineComparison(object):

    def __init__(self, attr):
        self.attr = attr

    def __eq__(self, other):
        if not isinstance(other, self.__class__):  # pragma: no cover
            raise TypeError()
        return False  # pragma: no cover

    def __ne__(self, other):
        return not self == other  # pragma: no cover


def compare_repr(obj, expected):
    actual = diff(expected, repr(obj))
    if actual:  # pragma: no cover
        raise AssertionError(actual)


class TestC(TestCase):

    def test_example(self):<commit_msg>no longer needed.<commit_after>from unittest import TestCase
import sys

from testfixtures import Comparison as C, TempDirectory, compare, diff
from testfixtures.compat import PY2, PY3, exception_module
from testfixtures.shouldraise import ShouldAssert
from testfixtures.tests.sample1 import SampleClassA, a_function
import pytest


class AClass:

    def __init__(self, x, y=None):
        self.x = x
        if y:
            self.y = y

    def __repr__(self):
        return '<'+self.__class__.__name__+'>'


class BClass(AClass):
    pass


class WeirdException(Exception):
    def __init__(self, x, y):
        self.x = x
        self.y = y


class X(object):
    __slots__ = ['x']


class FussyDefineComparison(object):

    def __init__(self, attr):
        self.attr = attr

    def __eq__(self, other):
        if not isinstance(other, self.__class__):  # pragma: no cover
            raise TypeError()
        return False  # pragma: no cover

    def __ne__(self, other):
        return not self == other  # pragma: no cover


def compare_repr(obj, expected):
    actual = diff(expected, repr(obj))
    if actual:  # pragma: no cover
        raise AssertionError(actual)


class TestC(TestCase):

    def test_example(self):
{'fraction_non_alphanumeric': 0.09387430389817025, 'fraction_numerical': 0.002386634844868735, 'mean_word_length': 2.89922480620155, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '6597693', 'n_tokens_mistral': 797, 'n_tokens_neox': 765, 'n_words': 237}