code: def from_url(cls, server_url: str, **kwargs: t.Any) -> SyncGrpcClient:
      protocol_version = kwargs.get(
          "protocol_version", LATEST_PROTOCOL_VERSION
      )
  
      # Since v1, we introduce a ServiceMetadata rpc to retrieve bentoml.Service metadata.
      # then `client.predict` or `client.classify` won't be available.
      # client.Call will still persist for both protocol version.
      if parse(protocol_version) < parse("v1"):
          exception_message = [
              f"Using protocol version {protocol_version} older than v1. 'bentoml.client.Client' will only support protocol version v1 onwards. To create client with protocol version '{protocol_version}', do the following:\n"
              f"""\
  
  from bentoml.grpc.utils import import_generated_stubs, import_grpc
  
  pb, services = import_generated_stubs("{protocol_version}")
  
  grpc, _ = import_grpc()
  
  def run():
      with grpc.insecure_channel("localhost:3000") as channel:
          stubs = services.BentoServiceStub(channel)
          req = stubs.Call(
              request=pb.Request(
                  api_name="predict",
                  ndarray=pb.NDArray(
                      dtype=pb.NDArray.DTYPE_FLOAT,
                      shape=(1, 4),
                      float_values=[5.9, 3, 5.1, 1.8],
                      ),
                  )
              )
              print(req)
  
  if __name__ == '__main__':
      run()
  """
          ]
          raise BentoMLException("\n".join(exception_message))
      pb, _ = import_generated_stubs(protocol_version)
  
      with GrpcClient._create_channel(
          server_url.replace(r"localhost", "0.0.0.0"),
          ssl=kwargs.get("ssl", False),
          ssl_client_credentials=kwargs.get(
              "ssl_client_credentials", None
          ),
          channel_options=kwargs.get("channel_options", None),
          compression=kwargs.get("compression", None),
      ) as channel:
          # create an insecure channel to invoke ServiceMetadata rpc
          metadata = t.cast(
              "ServiceMetadataResponse",
              channel.unary_unary(
                  f"/bentoml.grpc.{protocol_version}.BentoService/ServiceMetadata",
                  request_serializer=pb.ServiceMetadataRequest.SerializeToString,
                  response_deserializer=pb.ServiceMetadataResponse.FromString,
              )(pb.ServiceMetadataRequest()),
          )
      dummy_service = Service(metadata.name)
  
      for api in metadata.apis:
          try:
              dummy_service.apis[api.name] = InferenceAPI[t.Any](
                  None,
                  io_descriptors.from_spec(
                      {
                          "id": api.input.descriptor_id,
                          "args": _json_format.MessageToDict(
                              api.input.attributes
                          ).get("args", None),
                      }
                  ),
                  io_descriptors.from_spec(
                      {
                          "id": api.output.descriptor_id,
                          "args": _json_format.MessageToDict(
                              api.output.attributes
                          ).get("args", None),
                      }
                  ),
                  name=api.name,
                  doc=api.docs,
              )
          except BentoMLException as e:
              logger.error(
                  "Failed to instantiate client for API %s: ",
                  api.name,
                  e,
              )
  
      return cls(server_url, dummy_service, **kwargs)
  
imports: from __future__ import annotations
  import asyncio
  import logging
  import time
  import typing
  from functools import cached_property
  from typing import TYPE_CHECKING
  from packaging.version import parse
  from ...exceptions import BentoMLException
  from ...grpc.utils import LATEST_PROTOCOL_VERSION
  from ...grpc.utils import import_generated_stubs
  from ...grpc.utils import import_grpc
  from ...grpc.utils import load_from_file
  from ..None import io_descriptors
  from ..service import Service
  from ..service.inference_api import InferenceAPI
  from ..utils import LazyLoader
  from .None import AsyncClient
  from .None import Client
  from .None import SyncClient
label_desc: Use image node_id 10 for calling the SyncGrpcClient obj's underlying member method code with example usage: obj.from_url(cls, server_url) and returns: cls