code: def test_plugin_registry_context():
      plugins = GeneralCallableRegistry()
  
      plugins.register("default", lambda x, p=2: x**p)
  
      # At first there is no plugin enabled
      assert plugins.active == ""
      assert plugins.options == {}
  
      # Make sure the context is set and reset correctly
      with plugins.enable("default", p=6):
          assert plugins.active == "default"
          assert plugins.options == {"p": 6}
  
      assert plugins.active == ""
      assert plugins.options == {}
  
      # Make sure the context is reset even if there is an error
      try:
          with plugins.enable("default", p=6):
              assert plugins.active == "default"
              assert plugins.options == {"p": 6}
              raise ValueError()
      except ValueError:
          pass
  
      assert plugins.active == ""
      assert plugins.options == {}
  
      # Enabling without specifying name uses current name
      plugins.enable("default", p=2)
  
      with plugins.enable(p=6):
          assert plugins.active == "default"
          assert plugins.options == {"p": 6}
  
      assert plugins.active == "default"
      assert plugins.options == {"p": 2}
  
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 4 for calling a global function with example usage: test_plugin_registry_context() without return types