code: def constructor_test_helper(
      self,
      config,
      hook_type,
      hook_registry_name=None,
      hook_kwargs=None,
      invalid_configs=None,
  ):
      hook_kwargs = config if hook_kwargs is None else hook_kwargs
      hook1 = hook_type(**hook_kwargs)
      self.assertTrue(isinstance(hook1, hook_type))
  
      hook2 = hook_type.from_config(config)
      self.assertTrue(isinstance(hook2, hook_type))
  
      if hook_registry_name is not None:
          config["name"] = hook_registry_name
          hook3 = build_hook(config)
          del config["name"]
          self.assertTrue(isinstance(hook3, hook_type))
  
      if invalid_configs is not None:
          # Verify assert logic works correctly
          for cfg in invalid_configs:
              with self.assertRaises(
                  (AssertionError, TypeError, KeyError, ValueError)
              ):
                  hook_type.from_config(cfg)
  
imports: import unittest
  from classy_vision.hooks import build_hook
label_desc: Use image node_id 1 for calling the HookTestBase obj's underlying member method code with example usage: obj.constructor_test_helper(config, hook_type, hook_registry_name, hook_kwargs, invalid_configs) without return types