<commit_before>import unittest

import cupy


class TestGetSize(unittest.TestCase):

    def test_none(self):
        self.assertEqual(cupy._get_size(None), ())

    def check_collection(self, a):
        self.assertEqual(cupy._get_size(a), tuple(a))

    def test_list(self):
        self.check_collection([1, 2, 3])

    def test_tuple(self):
        self.check_collection((1, 2, 3))

    def test_int(self):
        self.assertEqual(cupy._get_size(1), (1,))

    def test_float(self):
        with self.assertRaises(ValueError):
            cupy._get_size(1.0)
<commit_msg>Add tests for cupy.ndarray.__init__<commit_after>import unittest

import cupy


class TestGetSize(unittest.TestCase):

    def test_none(self):
        self.assertEqual(cupy._get_size(None), ())

    def check_collection(self, a):
        self.assertEqual(cupy._get_size(a), tuple(a))

    def test_list(self):
        self.check_collection([1, 2, 3])

    def test_tuple(self):
        self.check_collection((1, 2, 3))

    def test_int(self):
        self.assertEqual(cupy._get_size(1), (1,))

    def test_float(self):
        with self.assertRaises(ValueError):
            cupy._get_size(1.0)


class TestNdarrayInit(unittest.TestCase):

    def test_shape_none(self):
        a = cupy.ndarray(None)
        self.assertTupleEqual(a.shape, ())

    def test_shape_int(self):
        a = cupy.ndarray(3)
        self.assertTupleEqual(a.shape, (3, ))

{'fraction_non_alphanumeric': 0.13086074177746676, 'fraction_numerical': 0.015395381385584325, 'mean_word_length': 3.0625, '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': '4989999', 'n_tokens_mistral': 511, 'n_tokens_neox': 485, 'n_words': 82}