code: def import_generated_stubs(
      version: str = LATEST_PROTOCOL_VERSION,
      file: str = "service.proto",
  ) -> tuple[types.ModuleType, types.ModuleType]:
      """
      Import generated stubs.
  
      Args:
          version: The version of the proto file to import.
          file: The name of the proto file to import.
  
      Returns:
          A tuple of the generated stubs for the proto file.
  
      Examples:
  
          .. code-block:: python
  
             from bentoml.grpc.utils import import_generated_stubs
  
             # given proto file bentoml/grpc/v1/service.proto exists
             pb, services = import_generated_stubs(version="v1", file="service.proto")
      """
      # generate git root from this file's path
      from bentoml._internal.utils import LazyLoader
  
      exception_message = f"Generated stubs for '{version}/{file}' are missing (broken installation). Please reinstall bentoml: 'pip install bentoml[grpc].'"
      file = file.split(".")[0]
  
      service_pb2 = LazyLoader(
          f"{file}_pb2",
          globals(),
          f"bentoml.grpc.{version}.{file}_pb2",
          exc_msg=exception_message,
      )
      service_pb2_grpc = LazyLoader(
          f"{file}_pb2_grpc",
          globals(),
          f"bentoml.grpc.{version}.{file}_pb2_grpc",
          exc_msg=exception_message,
      )
      return service_pb2, service_pb2_grpc
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING
label_desc: Use image node_id 1 for calling a global function with example usage: import_generated_stubs(version, file) and returns: service_pb2,  service_pb2_grpc