code: def test_instance_methods(self):
      a = matrix([1.0], dtype="f8")
      methodargs = {
          "astype": ("intc",),
          "clip": (0.0, 1.0),
          "compress": ([1],),
          "repeat": (1,),
          "reshape": (1,),
          "swapaxes": (0, 0),
          "dot": np.array([1.0]),
      }
      excluded_methods = [
          "argmin",
          "choose",
          "dump",
          "dumps",
          "fill",
          "getfield",
          "getA",
          "getA1",
          "item",
          "nonzero",
          "put",
          "putmask",
          "resize",
          "searchsorted",
          "setflags",
          "setfield",
          "sort",
          "partition",
          "argpartition",
          "take",
          "tofile",
          "tolist",
          "tostring",
          "tobytes",
          "all",
          "any",
          "sum",
          "argmax",
          "argmin",
          "min",
          "max",
          "mean",
          "var",
          "ptp",
          "prod",
          "std",
          "ctypes",
          "itemset",
      ]
      for attrib in dir(a):
          if attrib.startswith("_") or attrib in excluded_methods:
              continue
          f = getattr(a, attrib)
          if isinstance(f, collections.abc.Callable):
              # reset contents of a
              a.astype("f8")
              a.fill(1.0)
              if attrib in methodargs:
                  args = methodargs[attrib]
              else:
                  args = ()
              b = f(*args)
              assert_(type(b) is matrix, "%s" % attrib)
      assert_(type(a.real) is matrix)
      assert_(type(a.imag) is matrix)
      c, d = matrix([0.0]).nonzero()
      assert_(type(c) is np.ndarray)
      assert_(type(d) is np.ndarray)
  
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
  from numpy.matrixlib import mat
label_desc: Use image node_id 1 for calling the TestMatrixReturn obj's underlying member method code with example usage: obj.test_instance_methods() without return types