code: def test_expand_dims_matrix(self):
      # matrices are always 2d - so expand_dims only makes sense when the
      # type is changed away from matrix.
      a = np.arange(10).reshape((2, 5)).view(np.matrix)
      expanded = np.expand_dims(a, axis=1)
      assert_equal(expanded.ndim, 3)
      assert_(not isinstance(expanded, np.matrix))
  
imports: import collections.abc
  import numpy
  from numpy import matrix, asmatrix, bmat
  from numpy.testing import assert_, assert_equal, assert_almost_equal, assert_array_equal, assert_array_almost_equal, assert_raises
  from numpy.linalg import matrix_power
label_desc: Use image node_id 9 for calling the TestShape obj's underlying member method code with example usage: obj.test_expand_dims_matrix() without return types