<commit_before>import numpy as np
from numpy.ctypeslib import ndpointer, load_library
from numpy.testing import *

class TestLoadLibrary(NumpyTestCase):
    def check_basic(self):
        cdll = load_library('multiarray',
                            np.core.multiarray.__file__)

class TestNdpointer(NumpyTestCase):
    def check_dtype(self):
        dt = np.intc
        p = ndpointer(dtype=dt)
        self.assert_(p.from_param(np.array([1], dt)))
        dt = '<i4'
        p = ndpointer(dtype=dt)
        self.assert_(p.from_param(np.array([1], dt)))
        dt = np.dtype('>i4')<commit_msg>Do not fail test when ctypes is not available; print a message about skipping the test instead.<commit_after>import numpy as np
from numpy.ctypeslib import ndpointer, load_library
from numpy.testing import *

class TestLoadLibrary(NumpyTestCase):
    def check_basic(self):
        try:
            cdll = load_library('multiarray',
                                np.core.multiarray.__file__)
        except ImportError, e:
            msg = "ctypes is not available on this python: skipping the test" \
                  " (import error was: %s)" % str(e)
            print msg

class TestNdpointer(NumpyTestCase):
    def check_dtype(self):
        dt = np.intc
        p = ndpointer(dtype=dt)
        self.assert_(p.from_param(np.array([1], dt)))
        dt = '<i4'
        p = ndpointer(dtype=dt)
        self.assert_(p.from_param(np.array([1], dt)))
        dt = np.dtype('>i4')
{'fraction_non_alphanumeric': 0.11156186612576065, 'fraction_numerical': 0.005409060175794456, 'mean_word_length': 2.4660421545667446, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5083092', 'n_tokens_mistral': 448, 'n_tokens_neox': 454, 'n_words': 111}