code: def test_fix_with_subclass(self):
      class MyArray(nx.ndarray):
          def __new__(cls, data, metadata=None):
              res = nx.array(data, copy=True).view(cls)
              res.metadata = metadata
              return res
  
          def __array_wrap__(self, obj, context=None):
              if isinstance(obj, MyArray):
                  obj.metadata = self.metadata
              return obj
  
          def __array_finalize__(self, obj):
              self.metadata = getattr(obj, "metadata", None)
              return self
  
      a = nx.array([1.1, -1.1])
      m = MyArray(a, metadata="foo")
      f = ufl.fix(m)
      assert_array_equal(f, nx.array([1, -1]))
      assert_(isinstance(f, MyArray))
      assert_equal(f.metadata, "foo")
  
      # check 0d arrays don't decay to scalars
      m0d = m[0, ...]
      m0d.metadata = "bar"
      f0d = ufl.fix(m0d)
      assert_(isinstance(f0d, MyArray))
      assert_equal(f0d.metadata, "bar")
  
file_path: catboost/contrib/python/numpy/py3/numpy/lib/tests/test_ufunclike.py
imports: import numpy
  import numpy.core
  import numpy.lib.ufunclike
  from numpy.testing import assert_, assert_equal, assert_array_equal, assert_warns, assert_raises
label_desc: Use image node_id 4 for calling the TestUfunclike obj's underlying member method code with example usage: obj.test_fix_with_subclass() and returns: res, obj, self