code: def test_service_init_checks():
      py_model1 = bentoml.picklable_model.get(
          "py_model.case-1.http.e2e"
      ).to_runner(name="invalid")
      py_model2 = bentoml.picklable_model.get(
          "py_model.case-1.http.e2e"
      ).to_runner(name="invalid")
      with pytest.raises(ValueError) as excinfo:
          _ = bentoml.Service(
              name="duplicates_runners", runners=[py_model1, py_model2]
          )
      assert "Found duplicate name" in str(excinfo.value)
  
      with pytest.raises(AssertionError) as excinfo:
          _ = bentoml.Service(name="invalid_model_type", models=[1])
      assert "Service models list can only" in str(excinfo.value)
  
file_path: BentoML/tests/e2e/bento_server_http/tests/test_meta.py
imports: from __future__ import annotations
  import asyncio
  import time
  from pathlib import Path
  import pytest
  import bentoml
  from bentoml.testing.utils import async_request
label_desc: Use image node_id 1 for calling a global function with example usage: test_service_init_checks() without return types