code: def test_pm(pm):
      """Basic registration with objects"""
  
      class A(object):
          pass
  
      a1, a2 = A(), A()
      pm.register(a1)
      assert pm.is_registered(a1)
      pm.register(a2, "hello")
      assert pm.is_registered(a2)
      out = pm.get_plugins()
      assert a1 in out
      assert a2 in out
      assert pm.get_plugin("hello") == a2
      assert pm.unregister(a1) == a1
      assert not pm.is_registered(a1)
  
      out = pm.list_name_plugin()
      assert len(out) == 1
      assert out == [("hello", a2)]
  
imports: import pytest
  import types
  from pluggy import PluginManager, PluginValidationError, HookCallError, HookimplMarker, HookspecMarker
  from pluggy.manager import importlib_metadata
label_desc: Use image node_id 2 for calling a global function with example usage: test_pm(pm) without return types