code: def test_tagged_registry() -> None:
      class TestTag(Tag["TestTag"]):
          pass
  
      t1 = TestTag("t1")
      t2 = TestTag("t2")
  
      class TestTagged(Tagged[TestTag]):
          def __init__(
              self, name: str, tags: AbstractSet[TestTag]
          ) -> None:
              self.name = name
              self.tags = tags
  
      o1 = TestTagged("o1", {t1})
      o2 = TestTagged("o2", {t1, t2})
      o3 = TestTagged("o3", {t2})
  
      reg: TaggedRegistry[TestTagged, TestTag] = TaggedRegistry()
  
      assert () == reg.names()
      assert () == reg.all()
      assert () == reg.where(t1)
      assert () == reg.where(t1 & ~t2)
  
      assert o1 == reg.add(o1)
      assert o2 == reg.add(o2)
      assert o3 == reg.add(o3)
  
      assert ("o1", "o2", "o3") == reg.names()
      assert (o1, o2, o3) == reg.all()
      assert (o1, o2) == reg.where(t1)
      assert (o1,) == reg.where(t1 & ~t2)
      assert o1 == reg.get("o1")
      assert o2 == reg.get("o2")
      assert o3 == reg.get("o3")
  
      o1_2 = TestTagged("o1", {t2})
      with pytest.raises(AssertionError):
          reg.add(o1_2)
  
imports: from typing import AbstractSet
  import pytest
  from benchmark.registry import Named, Registry, Tagged, TaggedRegistry
  from benchmark.tag import Tag
label_desc: Use image node_id 2 for calling a global function with example usage: test_tagged_registry() without return types