<commit_before>import unittest
import numpy as np

from desc.backend import put
from desc.utils import sign


class TestBackend(unittest.TestCase):
    """tests for backend functions"""

    def test_put(self):
        a = np.array([0, 0, 0])
        b = np.array([1, 2, 3])

        a = put(a, [0, 1, 2], [1, 2, 3])

        np.testing.assert_array_almost_equal(a, b)

    def test_sign(self):

        self.assertEqual(sign(4), 1)
        self.assertEqual(sign(0), 1)
        self.assertEqual(sign(-10.3), -1)
<commit_msg>Updated "put" test to avoid deprecated usage<commit_after>import unittest
import numpy as np

from desc.backend import put
from desc.utils import sign


class TestBackend(unittest.TestCase):
    """tests for backend functions"""

    def test_put(self):
        a = np.array([0, 0, 0])
        b = np.array([1, 2, 3])

        a = put(a, np.array([0, 1, 2]), np.array([1, 2, 3]))

        np.testing.assert_array_almost_equal(a, b)

    def test_sign(self):

        self.assertEqual(sign(4), 1)
        self.assertEqual(sign(0), 1)
        self.assertEqual(sign(-10.3), -1)

{'fraction_non_alphanumeric': 0.14558689717925385, 'fraction_numerical': 0.036396724294813464, 'mean_word_length': 2.8062283737024223, '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': '3586952', 'n_tokens_mistral': 404, 'n_tokens_neox': 368, 'n_words': 102}