code: def test_array_astype():
      # 2018-04-29: copied here from core.tests.test_api
      # subok=True passes through a matrix
      a = np.matrix([[0, 1, 2], [3, 4, 5]], dtype="f4")
      b = a.astype("f4", subok=True, copy=False)
      assert_(a is b)
  
      # subok=True is default, and creates a subtype on a cast
      b = a.astype("i4", copy=False)
      assert_equal(a, b)
      assert_equal(type(b), np.matrix)
  
      # subok=False never returns a matrix
      b = a.astype("f4", subok=False, copy=False)
      assert_equal(a, b)
      assert_(not (a is b))
      assert_(type(b) is not np.matrix)
  
imports: import pytest
  import textwrap
  import warnings
  import numpy
  from numpy.testing import assert_, assert_equal, assert_raises, assert_raises_regex, assert_array_equal, assert_almost_equal, assert_array_almost_equal
label_desc: Use image node_id 10 for calling a global function with example usage: test_array_astype() without return types