class_docstr: Test ops
code: def test_registry(self):
      # pylint: disable=unused-variable
      @register(name="add_operator")
      class AddOperator:
          def __init__(self, factor):
              self.factor = factor
  
          def __call__(self, x):
              return self.factor + x
  
      @register
      def sub_operator(x, y):
          return x - y
  
      op = ops.sub_operator()
      res = op(11, 2)
      self.assertEqual(op.name, "sub-operator")
      self.assertEqual(op.init_args, ())
      self.assertEqual(op.init_kws, {})
      self.assertEqual(op.tag, "main")
      self.assertEqual(res, 9)
  
      op = ops.add_operator(factor=11)
      res = op(2)
      self.assertEqual(op.name, "add-operator")
      self.assertEqual(op.init_args, ())
      self.assertEqual(op.init_kws, {"factor": 11})
      self.assertEqual(res, 13)
  
file_path: towhee/tests/unittests/runtime/test_factory.py
imports: import unittest
  from towhee.runtime import ops, register
label_desc: Use image node_id 5 for calling the TestOps obj's underlying member method code with example usage: obj.test_registry() and returns: unknown, unknown