<commit_before>try:
    from builtins import object
except ImportError:
    pass

from transitions import Machine, MachineError
from unittest import TestCase
import tempfile
import os


class TestDiagrams(TestCase):

    def test_agraph_diagram(self):
        states = ['A', 'B', 'C', 'D']
        transitions = [
            {'trigger': 'walk', 'source': 'A', 'dest': 'B'},
            {'trigger': 'run', 'source': 'B', 'dest': 'C'},
            {'trigger': 'sprint', 'source': 'C', 'dest': 'D'}
        ]

        m = Machine(states=states, transitions=transitions, initial='A')
        graph = m.get_graph()

        # check for a valid pygraphviz diagram
        self.assertNotEquals(graph, None)
        self.assertTrue("digraph" in str(graph))

        # write diagram to temp file
        target = tempfile.NamedTemporaryFile()
        graph.draw(target.name, prog='dot')
        self.assertTrue(os.path.getsize(target.name) > 0)

        # cleanup temp file
        target.close()
<commit_msg>check with the correct assertion<commit_after>try:
    from builtins import object
except ImportError:
    pass

from transitions import Machine, MachineError
from unittest import TestCase
import tempfile
import os


class TestDiagrams(TestCase):

    def test_agraph_diagram(self):
        states = ['A', 'B', 'C', 'D']
        transitions = [
            {'trigger': 'walk', 'source': 'A', 'dest': 'B'},
            {'trigger': 'run', 'source': 'B', 'dest': 'C'},
            {'trigger': 'sprint', 'source': 'C', 'dest': 'D'}
        ]

        m = Machine(states=states, transitions=transitions, initial='A')
        graph = m.get_graph()

        # check for a valid pygraphviz diagram
        self.assertIsNotNone(graph)
        self.assertTrue("digraph" in str(graph))

        # write diagram to temp file
        target = tempfile.NamedTemporaryFile()
        graph.draw(target.name, prog='dot')
        self.assertTrue(os.path.getsize(target.name) > 0)

        # cleanup temp file
        target.close()

{'fraction_non_alphanumeric': 0.13846153846153847, 'fraction_numerical': 0.0009925558312655087, 'mean_word_length': 2.6923076923076925, 'pattern_counts': {'":': 0, '<': 3, '<?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': '775360', 'n_tokens_mistral': 599, 'n_tokens_neox': 587, 'n_words': 165}