<commit_before>import pytest

import xchainer


_dtypes_data = [
    (xchainer.bool, 'bool', '?', 1),
    (xchainer.int8, 'int8', 'b', 1),
    (xchainer.int16, 'int16', 'h', 2),
    (xchainer.int32, 'int32', 'i', 4),
    (xchainer.int64, 'int64', 'q', 8),
    (xchainer.uint8, 'uint8', 'B', 1),
    (xchainer.float32, 'float32', 'f', 4),
    (xchainer.float64, 'float64', 'd', 8),
]


def test_dtypes_covered(dtype):
    # This test ensures _dtypes_data covers all dtypes
    assert any(tup[0] == dtype for tup in _dtypes_data), 'Not all dtypes are covered in _dtypes_data in dtypes test.'


@pytest.mark.parametrize("dtype,name,char,itemsize", _dtypes_data)
def test_dtypes(dtype, name, char, itemsize):
    assert dtype == getattr(xchainer, name)
    assert dtype.name == name
    assert dtype.char == char
    assert dtype.itemsize == itemsize
    assert xchainer.dtype(name) == dtype
    assert xchainer.dtype(char) == dtype
    assert xchainer.dtype(dtype) == dtype


@pytest.mark.parametrize("dtype,name,char,itemsize", _dtypes_data)
def test_implicitly_convertible(dtype, name, char, itemsize):
    assert dtype == dtype
    assert dtype == name
    assert dtype == char

<commit_msg>Remove implicitly_convertible tests because __eq__ definition makes dtype == string comparison to be False now<commit_after>import pytest

import xchainer


_dtypes_data = [
    (xchainer.bool, 'bool', '?', 1),
    (xchainer.int8, 'int8', 'b', 1),
    (xchainer.int16, 'int16', 'h', 2),
    (xchainer.int32, 'int32', 'i', 4),
    (xchainer.int64, 'int64', 'q', 8),
    (xchainer.uint8, 'uint8', 'B', 1),
    (xchainer.float32, 'float32', 'f', 4),
    (xchainer.float64, 'float64', 'd', 8),
]


def test_dtypes_covered(dtype):
    # This test ensures _dtypes_data covers all dtypes
    assert any(tup[0] == dtype for tup in _dtypes_data), 'Not all dtypes are covered in _dtypes_data in dtypes test.'


@pytest.mark.parametrize("dtype,name,char,itemsize", _dtypes_data)
def test_dtypes(dtype, name, char, itemsize):
    assert dtype == getattr(xchainer, name)
    assert dtype.name == name
    assert dtype.char == char
    assert dtype.itemsize == itemsize
    assert xchainer.dtype(name) == dtype
    assert xchainer.dtype(char) == dtype
    assert xchainer.dtype(dtype) == dtype


{'fraction_non_alphanumeric': 0.14744718309859156, 'fraction_numerical': 0.029049295774647887, 'mean_word_length': 4.11936936936937, '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': '7227388', 'n_tokens_mistral': 870, 'n_tokens_neox': 845, 'n_words': 211}