code: def _unregister_service(
      project: str,
      public_domain: str,
      gateway_ssh_private_key: str,
  ):
      try:
          with gateway_tunnel_client(
              public_domain, id_rsa=gateway_ssh_private_key
          ) as gateway_client:
              gateway_client.unregister_service(
                  project=project,
                  public_domain=public_domain,
              )
      except Exception as e:
          logger.warning("failed to unregister service: %s", e)
  
file_path: dstack/src/dstack/_internal/server/background/tasks/process_finished_jobs.py
imports: from sqlalchemy import or_, select
  from sqlalchemy.orm import joinedload
  from dstack._internal.core.models.runs import JobSpec, JobStatus
  from dstack._internal.server.db import get_session_ctx
  from dstack._internal.server.models import GatewayModel, JobModel
  from dstack._internal.server.services.gateways import gateway_tunnel_client
  from dstack._internal.server.services.jobs import TERMINATING_PROCESSING_JOBS_IDS, TERMINATING_PROCESSING_JOBS_LOCK, job_model_to_job_submission, terminate_job_submission_instance
  from dstack._internal.server.services.logging import job_log
  from dstack._internal.server.utils.common import run_async
  from dstack._internal.utils.common import get_current_datetime
  from dstack._internal.utils.logging import get_logger
label_desc: Use image node_id 1 for calling a global function with example usage: _unregister_service(project, public_domain, gateway_ssh_private_key) without return types