code: def test_ModelComponent_raises_if_model_is_empty_iterable():
      """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.
  
      """
  
      class ConfigComponent(ModelComponent):
          def __init__(self, model):
              pass
  
          @expose(inputs={"param": Number()}, outputs={"foo": Number()})
          def predict(self, param):
              return param
  
      with pytest.raises(ValueError, match="must have length >= 1"):
          _ = ConfigComponent([])
  
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 10 for calling a global function with example usage: test_ModelComponent_raises_if_model_is_empty_iterable() and returns: param