code: def test_iso_serving_mode(
      model_name, test_items, tf_serving, dummy_tf_models
  ):
      # model_name = "dummy_tf_model"
      # Get the prediction service running TF with gRPC serving
      lib_serving_grpc = ModelLibrary(
          required_models=[model_name],
          settings=LibrarySettings(
              tf_serving={
                  "enable": True,
                  "port": 8500,
                  "mode": "grpc",
                  "host": "localhost",
              }
          ),
          models=dummy_tf_models,
      )
      model_grpc = lib_serving_grpc.get(model_name)
  
      lib_serving_rest = ModelLibrary(
          required_models=[model_name],
          settings=LibrarySettings(
              tf_serving={
                  "enable": True,
                  "port": 8501,
                  "mode": "rest",
                  "host": "localhost",
              }
          ),
          models=dummy_tf_models,
      )
      model_rest = lib_serving_rest.get(model_name)
  
      # Get the prediction service running TF as a library
      lib_tflib = ModelLibrary(
          required_models=[model_name],
          settings=LibrarySettings(),
          models=dummy_tf_models,
      )
      assert not lib_tflib.settings.tf_serving.enable
      model_tflib = lib_tflib.get(model_name)
      _compare_models(model_tflib, model_grpc, test_items)
  
      model_grpc.grpc_stub = None
      _compare_models(model_rest, model_grpc, test_items)
      assert model_grpc.grpc_stub
  
      lib_serving_rest.close()
      lib_serving_grpc.close()
  
imports: import os
  import pytest
  import requests
  from modelkit import ModelLibrary, testing
  from modelkit.core.models.tensorflow_model import AsyncTensorflowModel, TensorflowModel, has_tensorflow
  from modelkit.core.settings import LibrarySettings
  from modelkit.testing import tf_serving_fixture
  from modelkit.utils.tensorflow import write_config
  from tests import TEST_DIR
  from tests.conftest import skip_unless
label_desc: Use image node_id 6 for calling a global function with example usage: test_iso_serving_mode(model_name, test_items, tf_serving, dummy_tf_models) without return types