<commit_before>import multiprocessing
import sys
import unittest
from io import StringIO
from unittest import TestCase
from unittest.mock import patch

from .cli import json_filter, todo, _batch, get_json_value


class CliTestCase(TestCase):
    def test_json_filter(self):
        json = {'a': {'b': 1, 'c': 2}, 'd': 3}

        res = json_filter(json, ('a.b',))
        self.assertDictEqual({'a': {'b': 1}}, res)

        res = json_filter(json, ('a',))
        self.assertDictEqual({'a': {'b': 1, 'c': 2}}, res)

        res = json_filter(json, ('a.c', 'd'))
        self.assertDictEqual({'a': {'c': 2}, 'd': 3}, res)

        res = json_filter(json, ('d',))
        self.assertDictEqual({'d': 3}, res)


class CliTodoTestCase(TestCase):<commit_msg>reverse relative import<commit_after>import multiprocessing
import sys
import unittest
from io import StringIO
from unittest import TestCase
from unittest.mock import patch

from cli import json_filter, todo, _batch, get_json_value


class CliTestCase(TestCase):
    def test_json_filter(self):
        json = {'a': {'b': 1, 'c': 2}, 'd': 3}

        res = json_filter(json, ('a.b',))
        self.assertDictEqual({'a': {'b': 1}}, res)

        res = json_filter(json, ('a',))
        self.assertDictEqual({'a': {'b': 1, 'c': 2}}, res)

        res = json_filter(json, ('a.c', 'd'))
        self.assertDictEqual({'a': {'c': 2}, 'd': 3}, res)

        res = json_filter(json, ('d',))
        self.assertDictEqual({'d': 3}, res)


class CliTodoTestCase(TestCase):
{'fraction_non_alphanumeric': 0.17779246530072704, 'fraction_numerical': 0.011896893588896233, 'mean_word_length': 3.4792899408284024, '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': '1632842', 'n_tokens_mistral': 543, 'n_tokens_neox': 508, 'n_words': 143}