code: def test_register(self):
      db = RewriteDatabase()
      db.register("a", TestRewriter())
  
      db.register("b", TestRewriter())
  
      db.register("c", TestRewriter(), "z", "asdf")
  
      assert "a" in db
      assert "b" in db
      assert "c" in db
  
      with pytest.raises(ValueError, match=r"The tag.*"):
          db.register("c", TestRewriter())  # name taken
  
      with pytest.raises(ValueError, match=r"The tag.*"):
          db.register("z", TestRewriter())  # name collides with tag
  
      with pytest.raises(ValueError, match=r"The tag.*"):
          db.register(
              "u", TestRewriter(), "b"
          )  # name new but tag collides with name
  
      with pytest.raises(TypeError, match=r".* is not a valid.*"):
          db.register("d", 1)
  
file_path: pytensor/tests/graph/rewriting/test_db.py
imports: import pytest
  from pytensor.graph.rewriting.basic import GraphRewriter, SequentialGraphRewriter
  from pytensor.graph.rewriting.db import EquilibriumDB, LocalGroupDB, ProxyDB, RewriteDatabase, SequenceDB
label_desc: Use image node_id 1 for calling the TestDB obj's underlying member method code with example usage: obj.test_register() without return types