code: def test_validate_return_spec():
      service_settings = LibrarySettings()
  
      class ItemModel(pydantic.BaseModel):
          x: int
  
      class SomeValidatedModel(Model[Any, ItemModel]):
          def _predict(self, item):
              return item
  
      m = SomeValidatedModel(service_settings=service_settings)
      ret = m({"x": 10})
      assert ret.x == 10
  
      with pytest.raises(ReturnValueValidationException):
          m({"x": "something", "blabli": 10})
  
file_path: modelkit/tests/test_validate.py
imports: from typing import Any, Dict, List
  import pydantic
  import pytest
  from modelkit.core.errors import ItemValidationException, ModelkitDataValidationException, ReturnValueValidationException
  from modelkit.core.model import AsyncModel, Model
  from modelkit.core.settings import LibrarySettings
label_desc: Use image node_id 4 for calling a global function with example usage: test_validate_return_spec() and returns: item