code: def test_serve_input():
      server_input = ServeInput()
      assert server_input.serving
      with pytest.raises(NotImplementedError):
          server_input._call_load_sample("")
  
      class CustomServeInput(ServeInput):
          def serve_load_data(self, data):
              raise NotImplementedError
  
          def serve_load_sample(self, data):
              return data + 1
  
      with pytest.raises(TypeError, match="serve_load_data"):
          serve_input = CustomServeInput()
  
      class CustomServeInput2(ServeInput):
          def serve_load_sample(self, data):
              return data + 1
  
      serve_input = CustomServeInput2()
      assert serve_input._call_load_sample(1) == 2
  
imports: import pytest
  from flash.core.data.io.input import Input, IterableInput, ServeInput
  from flash.core.utilities.imports import _TOPIC_CORE_AVAILABLE
  from flash.core.utilities.stages import RunningStage
label_desc: Use image node_id 3 for calling a global function with example usage: test_serve_input() and returns: unknown, unknown