<commit_before>"""
Python representations of the JSON Schema Test Suite tests.
"""

from functools import partial
import json
import os
import re
import subprocess
import sys
import unittest

try:
    from pathlib import Path
except ImportError:
    from pathlib2 import Path

import attr

from jsonschema.validators import validators
import jsonschema


def _find_suite():
    root = os.environ.get("JSON_SCHEMA_TEST_SUITE")
    if root is not None:
        return Path(root)

    root = Path(jsonschema.__file__).parent.parent / "json"
    if not root.is_dir():  # pragma: no cover
        raise ValueError(
            (
                "Can't find the JSON-Schema-Test-Suite directory. "<commit_msg>Remove pathlib2 compatibility code.<commit_after>"""
Python representations of the JSON Schema Test Suite tests.
"""

from functools import partial
from pathlib import Path
import json
import os
import re
import subprocess
import sys
import unittest

import attr

from jsonschema.validators import validators
import jsonschema


def _find_suite():
    root = os.environ.get("JSON_SCHEMA_TEST_SUITE")
    if root is not None:
        return Path(root)

    root = Path(jsonschema.__file__).parent.parent / "json"
    if not root.is_dir():  # pragma: no cover
        raise ValueError(
            (
                "Can't find the JSON-Schema-Test-Suite directory. "
{'fraction_non_alphanumeric': 0.07236842105263158, 'fraction_numerical': 0.0014619883040935672, 'mean_word_length': 3.238390092879257, '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': '2820434', 'n_tokens_mistral': 399, 'n_tokens_neox': 398, 'n_words': 140}