<commit_before>import pytest
from sol.utils.pythonHelper import tup2str, str2tup
import sol.utils.pythonHelper as ph

def testConverters():
    assert tup2str((1,2,'hi')) == '1_2_hi'
    assert str2tup('3_4') == ('3', '4')

def testOneDict():
    d = ph.alwaysOneDict()
    assert d[1] == 1
    assert d[2] == 1
    assert d['hidhf'] == 1
    with pytest.raises(TypeError):
        d[2] = -1
    assert d[2] == 1
<commit_msg>Adding some tests for the python helper<commit_after>import pytest

import sol.utils.pythonHelper as ph
from sol.utils.pythonHelper import tup2str, str2tup


def testConverters():
    assert tup2str((1, 2, 'hi')) == '1_2_hi'
    assert str2tup('3_4') == ('3', '4')


def testOneDict():
    d = ph.alwaysOneDict()
    assert d[1] == 1
    assert d[2] == 1
    assert d['hidhf'] == 1
    with pytest.raises(TypeError):
        d[2] = -1
    assert d[2] == 1


def testListEq():
    assert ph.listEq([1], [1])
    assert ph.listEq([], [])
    assert ph.listEq([2, 2, 2, 2], [2, 2, 2, 2])
    assert ph.listEq([1], [0x1])
    assert not ph.listEq([1], [1, 1])
    assert not ph.listEq([2, 3, 4], [0, 2, 3, 4])
    assert not ph.listEq([2, 3, 4], [1, 3, 4])

{'fraction_non_alphanumeric': 0.1808149405772496, 'fraction_numerical': 0.06027164685908319, 'mean_word_length': 3.136842105263158, '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': '5919212', 'n_tokens_mistral': 499, 'n_tokens_neox': 475, 'n_words': 129}