code: def generate_service_stub(
      address: str,
      creds: Optional[grpc.ChannelCredentials] = None,
  ) -> execution_watcher_pb2_grpc.ExecutionWatcherServiceStub:
      """Generates a gRPC service stub for a given server address."""
      channel = (
          grpc.secure_channel(address, creds)
          if creds
          else grpc.insecure_channel(address)
      )
      return execution_watcher_pb2_grpc.ExecutionWatcherServiceStub(
          channel
      )
  
file_path: tfx/tfx/orchestration/portable/execution_watcher.py
imports: from concurrent import futures
  from typing import Optional
  from absl import logging
  import grpc
  from tfx.orchestration import metadata
  from tfx.proto.orchestration import execution_watcher_pb2
  from tfx.proto.orchestration import execution_watcher_pb2_grpc
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: generate_service_stub(address, creds) and returns: execution_watcher_pb2_grpc