code: def test_registry_raises():
      backbones = FlashRegistry("backbones")
  
      @backbones
      def my_model(nc_input=5, nc_output=6):
          return nn.Linear(nc_input, nc_output), nc_input, nc_output
  
      with pytest.raises(
          TypeError, match="You can only register a callable, found: 3"
      ):
          backbones(3, name="foo")
  
      backbones(my_model, name="foo", override=True)
  
      with pytest.raises(
          ValueError, match="Function with name: foo and metadata: {}"
      ):
          backbones(my_model, name="foo", override=False)
  
      with pytest.raises(KeyError, match="Found no matches"):
          backbones.get("foo", baz="bar")
  
      backbones.remove("foo")
      with pytest.raises(
          KeyError, match="Key: foo is not in FlashRegistry"
      ):
          backbones.get("foo")
  
      with pytest.raises(TypeError, match="name` must be a str"):
          backbones(name=float)
  
file_path: lightning-flash/tests/core/test_registry.py
imports: import logging
  import pytest
  from flash.core.registry import ConcatRegistry, ExternalRegistry, FlashRegistry
  from flash.core.utilities.imports import _TOPIC_CORE_AVAILABLE
  from torch import nn
label_desc: Use image node_id 1 for calling a global function with example usage: test_registry_raises() and returns: nn,  nc_input,  nc_output