code: def test_ModelComponent_raises_if_exposed_input_keys_differ_from_decorated_method_parameters(
      lightning_squeezenet1_1_obj,
  ):
      """This occurs when the instance is being initialized.
  
      This is noted because it differs from some other metaclass validations which will raise an exception at class
      definition time.
  
      """
      from tests.core.serve.models import ClassificationInference
  
      class FailedExposedDecorator(ModelComponent):
          def __init__(self, model):
              self.model = model
  
          @expose(
              inputs={"NOT_NAMED": Number()}, outputs={"foo": Number()}
          )
          def predict(self, param):
              return param
  
      comp = ClassificationInference(lightning_squeezenet1_1_obj)
  
      with pytest.raises(
          RuntimeError, match="`@expose` must list all method arguments"
      ):
          _ = FailedExposedDecorator(comp)
  
file_path: lightning-flash/tests/core/serve/test_gridbase_validations.py
imports: import pytest
  from flash.core.serve import ModelComponent, expose
  from flash.core.serve.types import Number
  from flash.core.utilities.imports import _CYTOOLZ_AVAILABLE, _TOPIC_SERVE_AVAILABLE
label_desc: Use image node_id 8 for calling a global function with example usage: test_ModelComponent_raises_if_exposed_input_keys_differ_from_decorated_method_parameters(lightning_squeezenet1_1_obj) and returns: param