code: def test_plugin_registry():
      plugins = TypedCallableRegistry()
  
      assert plugins.names() == []
      assert plugins.active == ""
      assert plugins.get() is None
      assert (
          repr(plugins)
          == "TypedCallableRegistry(active='', registered=[])"
      )
  
      plugins.register("new_plugin", lambda x: x**2)
      assert plugins.names() == ["new_plugin"]
      assert plugins.active == ""
      assert plugins.get() is None
      assert repr(plugins) == (
          "TypedCallableRegistry(active='', "
          "registered=['new_plugin'])"
      )
  
      plugins.enable("new_plugin")
      assert plugins.names() == ["new_plugin"]
      assert plugins.active == "new_plugin"
      assert plugins.get()(3) == 9
      assert repr(plugins) == (
          "TypedCallableRegistry(active='new_plugin', "
          "registered=['new_plugin'])"
      )
  
file_path: altair/tests/utils/test_plugin_registry.py
imports: from altair.utils.plugin_registry import PluginRegistry
  from typing import Callable
label_desc: Use image node_id 1 for calling a global function with example usage: test_plugin_registry() without return types