code: def test_pm_name(pm):
      class A(object):
          pass
  
      a1 = A()
      name = pm.register(a1, name="hello")
      assert name == "hello"
      pm.unregister(a1)
      assert pm.get_plugin(a1) is None
      assert not pm.is_registered(a1)
      assert not pm.get_plugins()
      name2 = pm.register(a1, name="hello")
      assert name2 == name
      pm.unregister(name="hello")
      assert pm.get_plugin(a1) is None
      assert not pm.is_registered(a1)
      assert not pm.get_plugins()
  
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 5 for calling a global function with example usage: test_pm_name(pm) without return types