code: def test_array_attributes():
      from pybind11_tests.array import (
          ndim,
          shape,
          strides,
          writeable,
          size,
          itemsize,
          nbytes,
          owndata,
      )
  
      a = np.array(0, "f8")
      assert ndim(a) == 0
      assert all(shape(a) == [])
      assert all(strides(a) == [])
      with pytest.raises(IndexError) as excinfo:
          shape(a, 0)
      assert str(excinfo.value) == "invalid axis: 0 (ndim = 0)"
      with pytest.raises(IndexError) as excinfo:
          strides(a, 0)
      assert str(excinfo.value) == "invalid axis: 0 (ndim = 0)"
      assert writeable(a)
      assert size(a) == 1
      assert itemsize(a) == 8
      assert nbytes(a) == 8
      assert owndata(a)
  
      a = np.array([[1, 2, 3], [4, 5, 6]], "u2").view()
      a.flags.writeable = False
      assert ndim(a) == 2
      assert all(shape(a) == [2, 3])
      assert shape(a, 0) == 2
      assert shape(a, 1) == 3
      assert all(strides(a) == [6, 2])
      assert strides(a, 0) == 6
      assert strides(a, 1) == 2
      with pytest.raises(IndexError) as excinfo:
          shape(a, 2)
      assert str(excinfo.value) == "invalid axis: 2 (ndim = 2)"
      with pytest.raises(IndexError) as excinfo:
          strides(a, 2)
      assert str(excinfo.value) == "invalid axis: 2 (ndim = 2)"
      assert not writeable(a)
      assert size(a) == 6
      assert itemsize(a) == 2
      assert nbytes(a) == 12
      assert not owndata(a)
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/deps/pybind11/tests/test_numpy_array.py
imports: import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: test_array_attributes() without return types