code: def test_pm_name(pm: PluginManager) -> None:
      class A:
          pass
  
      a1 = A()
      name = pm.register(a1, name="hello")
      assert name == "hello"
      pm.unregister(a1)
      assert pm.get_plugin("hello") 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("hello") is None
      assert not pm.is_registered(a1)
      assert not pm.get_plugins()
  
imports: import sys
  from typing import Any
  from typing import List
  import pytest
  from pluggy import HookCallError
  from pluggy import HookimplMarker
  from pluggy import HookspecMarker
  from pluggy import PluginManager
  from pluggy import PluginValidationError
label_desc: Use image node_id 5 for calling a global function with example usage: test_pm_name(pm) without return types