code: def test_wrap():
      from pybind11_tests.array import wrap
  
      def assert_references(a, b):
          assert a is not b
          assert (
              a.__array_interface__["data"][0]
              == b.__array_interface__["data"][0]
          )
          assert a.shape == b.shape
          assert a.strides == b.strides
          assert a.flags.c_contiguous == b.flags.c_contiguous
          assert a.flags.f_contiguous == b.flags.f_contiguous
          assert a.flags.writeable == b.flags.writeable
          assert a.flags.aligned == b.flags.aligned
          assert a.flags.updateifcopy == b.flags.updateifcopy
          assert np.all(a == b)
          assert not b.flags.owndata
          assert b.base is a
          if a.flags.writeable and a.ndim == 2:
              a[0, 0] = 1234
              assert b[0, 0] == 1234
  
      a1 = np.array([1, 2], dtype=np.int16)
      assert a1.flags.owndata and a1.base is None
      a2 = wrap(a1)
      assert_references(a1, a2)
  
      a1 = np.array([[1, 2], [3, 4]], dtype=np.float32, order="F")
      assert a1.flags.owndata and a1.base is None
      a2 = wrap(a1)
      assert_references(a1, a2)
  
      a1 = np.array([[1, 2], [3, 4]], dtype=np.float32, order="C")
      a1.flags.writeable = False
      a2 = wrap(a1)
      assert_references(a1, a2)
  
      a1 = np.random.random((4, 4, 4))
      a2 = wrap(a1)
      assert_references(a1, a2)
  
      a1 = a1.transpose()
      a2 = wrap(a1)
      assert_references(a1, a2)
  
      a1 = a1.diagonal()
      a2 = wrap(a1)
      assert_references(a1, a2)
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/deps/pybind11/tests/test_numpy_array.py
imports: import pytest
label_desc: Use image node_id 12 for calling a global function with example usage: test_wrap() without return types