<commit_before>#! /usr/bin/env python
import random
# import sys

import numpy as np

from mann import helper

def test_convert_str_to_int_list():
    converted = helper.convert_str_to_int_array('1, 2, 3')
    expected = np.array([1, 2, 3])
    assert np.array_equal(converted, expected)

def test_convert_list_to_delim_str():
    converted = helper.convert_list_to_delim_str([1, 2, 3])
    expected = '1,2,3'
    assert converted == expected

def test_flip_1_0():
    calculated = helper.flip_1_0(1)
    expected = 0
    assert calculated == expected

    calculated = helper.flip_1_0(0)
    expected = 1
    assert calculated == expected

def test_mutate():
    calculated = helper.mutate([0, 0, 0, 0], 0)
    expected = [0, 0, 0, 0]
    assert np.array_equal(np.array(calculated), np.array(expected))

    calculated = helper.mutate([0, 0, 0, 0], 1)
    expected = [1, 1, 1, 1]
    assert np.array_equal(np.array(calculated), np.array(expected))<commit_msg>rename unittest function to denote array, instead of list<commit_after>#! /usr/bin/env python
import random
# import sys

import numpy as np

from mann import helper

def test_convert_str_to_int_array():
    converted = helper.convert_str_to_int_array('1, 2, 3')
    expected = np.array([1, 2, 3])
    assert np.array_equal(converted, expected)

def test_convert_list_to_delim_str():
    converted = helper.convert_list_to_delim_str([1, 2, 3])
    expected = '1,2,3'
    assert converted == expected

def test_flip_1_0():
    calculated = helper.flip_1_0(1)
    expected = 0
    assert calculated == expected

    calculated = helper.flip_1_0(0)
    expected = 1
    assert calculated == expected

def test_mutate():
    calculated = helper.mutate([0, 0, 0, 0], 0)
    expected = [0, 0, 0, 0]
    assert np.array_equal(np.array(calculated), np.array(expected))

    calculated = helper.mutate([0, 0, 0, 0], 1)
    expected = [1, 1, 1, 1]
    assert np.array_equal(np.array(calculated), np.array(expected))
{'fraction_non_alphanumeric': 0.12468193384223919, 'fraction_numerical': 0.04071246819338423, 'mean_word_length': 3.8784119106699753, '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': '4186794', 'n_tokens_mistral': 739, 'n_tokens_neox': 689, 'n_words': 177}