<commit_before>import unittest

from copy import deepcopy

from tests.samples import agenda
from tests.samples import google_route
from wildpath.keyparser import KeyParser
from wildpath.paths import Path, WildPath


class Object(object):

    def __init__(self, **kwargs):
        for k, v in kwargs.items():
            setattr(self, k, v)

    def add(self, x, y, z=0):
        return self.s + x + y + z

    def __eq__(self, other):
        return self.__class__ == other.__class__ and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not self == other


class TestBase(unittest.TestCase):

    def setUp(self):
        self.simple = Object(
            a=1,
            b=[2, 3],
            c=dict(d=4, e=5),
            d=Object(e=6),
            e=[dict(a=7, b=8),
               dict(b=9, c=0),
               Object()],
            f=[[dict(a=[7,7], b=[8,8]),
                dict(b=[9,9], c=[0,0,0])],
               [dict(a=[1,1], b=[2,2]),
                dict(b=[3,3], c=[4,4,4])]],
        )
        self.complex = Object(
            aa=1,
            ba=[2, 3],
            bb=[4, 5],
            ca=dict(d=6, e=7, f=8),
            cb=Object(e=9),
            ff=[1,2,3,4,5,6],
            gg=[dict(a=1, b=2), dict(b=3, c=4), dict(a=5, b=6, c=7)],
        )

        self.agenda = agenda
        self.google_route = google_route


class TestPath(TestBase):

    def test_slice(self):
        path = Path("1.a.2.b.3.c")
        self.assertEqual(type(path[-1:0:-2]), Path)
        self.assertEqual(path[::2], Path("1.2.3"))
        self.assertEqual(path[1:-1], Path("a.2.b.3"))
        self.assertEqual(path[-1:0:-2], Path("c.b.a"))

    def test_some_basics(self):
        path = Path('')

    def test_basic_get(self):<commit_msg>unicode test<commit_after>import unittest

from copy import deepcopy

from tests.samples import agenda
from tests.samples import google_route
from wildpath.keyparser import KeyParser
from wildpath.paths import Path, WildPath


class Object(object):

    def __init__(self, **kwargs):
        for k, v in kwargs.items():
            setattr(self, k, v)

    def add(self, x, y, z=0):
        return self.s + x + y + z

    def __eq__(self, other):
        return self.__class__ == other.__class__ and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not self == other


class TestBase(unittest.TestCase):

    def setUp(self):
        self.simple = Object(
            a=1,
            b=[2, 3],
            c=dict(d=4, e=5),
            d=Object(e=6),
            e=[dict(a=7, b=8),
               dict(b=9, c=0),
               Object()],
            f=[[dict(a=[7,7], b=[8,8]),
                dict(b=[9,9], c=[0,0,0])],
               [dict(a=[1,1], b=[2,2]),
                dict(b=[3,3], c=[4,4,4])]],
        )
        self.complex = Object(
            aa=1,
            ba=[2, 3],
            bb=[4, 5],
            ca=dict(d=6, e=7, f=8),
            cb=Object(e=9),
            ff=[1,2,3,4,5,6],
            gg=[dict(a=1, b=2), dict(b=3, c=4), dict(a=5, b=6, c=7)],
        )

        self.agenda = agenda
        self.google_route = google_route


class TestPath(TestBase):

    def test_slice(self):
        path = Path("1.a.2.b.3.c")
        self.assertEqual(type(path[-1:0:-2]), Path)
        self.assertEqual(path[::2], Path("1.2.3"))
        self.assertEqual(path[1:-1], Path("a.2.b.3"))
        self.assertEqual(path[-1:0:-2], Path("c.b.a"))

    def test_some_basics(self):
        path = Path('')

    def test_unicode(self):
        path = Path(u"a.0")
        self.assertEqual(path.get_in({"a": [1]}), 1)

    def test_basic_get(self):
{'fraction_non_alphanumeric': 0.1757310740639519, 'fraction_numerical': 0.03798852145394917, 'mean_word_length': 1.9611650485436893, 'pattern_counts': {'":': 1, '<': 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': '6570652', 'n_tokens_mistral': 1344, 'n_tokens_neox': 1297, 'n_words': 267}