class_docstr: A local client for submitting and interacting with jobs on a remote cluster.
  
  Submits requests over HTTP to the job server on the cluster using the REST API.
  
  
  Args:
      address: Either (1) the address of the Ray cluster, or (2) the HTTP address
          of the dashboard server on the head node, e.g. "http://<head-node-ip>:8265".
          In case (1) it must be specified as an address that can be passed to
          ray.init(), e.g. a Ray Client address (ray://<head_node_host>:10001),
          or "auto", or "localhost:<port>". If unspecified, will try to connect to
          a running local Ray cluster. This argument is always overridden by the
          RAY_ADDRESS environment variable.
      create_cluster_if_needed: Indicates whether the cluster at the specified
          address needs to already be running. Ray doesn't start a cluster
          before interacting with jobs, but third-party job managers may do so.
      cookies: Cookies to use when sending requests to the HTTP job server.
      metadata: Arbitrary metadata to store along with all jobs.  New metadata
          specified per job will be merged with the global metadata provided here
          via a simple dict update.
      headers: Headers to use when sending requests to the HTTP job server, used
          for cases like authentication to a remote cluster.
      verify: Boolean indication to verify the server's TLS certificate or a path to
          a file or directory of trusted certificates. Default: True.
class_docstr_tok: ["A","local","client","for","submitting","and","interacting","with","jobs","on","a","remote","cluster",".","Submits","requests","over","HTTP","to","the","job","server","on","the","cluster","using","the","REST","API",".","Args",":","address",":","Either","(","1",")","the","address","of","the","Ray","cluster",",","or","(","2",")","the","HTTP","address","of","the","dashboard","server","on","the","head","node",",","e.g",".","``","http",":","\/\/","<","head-node-ip",">",":8265","''",".","In","case","(","1",")","it","must","be","specified","as","an","address","that","can","be","passed","to","ray.init","(",")",",","e.g",".","a","Ray","Client","address","(","ray",":","\/\/","<","head_node_host",">",":10001",")",",","or","``","auto","''",",","or","``","localhost",":","<","port",">","''",".","If","unspecified",",","will","try","to","connect","to","a","running","local","Ray","cluster",".","This","argument","is","always","overridden","by","the","RAY_ADDRESS","environment","variable",".","create_cluster_if_needed",":","Indicates","whether","the","cluster","at","the","specified","address","needs","to","already","be","running",".","Ray","does","n't","start","a","cluster","before","interacting","with","jobs",",","but","third-party","job","managers","may","do","so",".","cookies",":","Cookies","to","use","when","sending","requests","to","the","HTTP","job","server",".","metadata",":","Arbitrary","metadata","to","store","along","with","all","jobs",".","New","metadata","specified","per","job","will","be","merged","with","the","global","metadata","provided","here","via","a","simple","dict","update",".","headers",":","Headers","to","use","when","sending","requests","to","the","HTTP","job","server",",","used","for","cases","like","authentication","to","a","remote","cluster",".","verify",":","Boolean","indication","to","verify","the","server","'s","TLS","certificate","or","a","path","to","a","file","or","directory","of","trusted","certificates",".","Default",":","True","."]
docstr: Request a job to exit asynchronously.
  
  Attempts to terminate process first, then kills process after timeout.
  
  Example:
      >>> from ray.job_submission import JobSubmissionClient
      >>> client = JobSubmissionClient("http://127.0.0.1:8265") # doctest: +SKIP
      >>> sub_id = client.submit_job(entrypoint="sleep 10") # doctest: +SKIP
      >>> client.stop_job(sub_id) # doctest: +SKIP
      True
  
  Args:
      job_id: The job ID or submission ID for the job to be stopped.
  
  Returns:
      True if the job was running, otherwise False.
  
  Raises:
      RuntimeError: If the job does not exist or if the request to the
          job server fails.
docstr_tok: ["Request","a","job","to","exit","asynchronously",".","Attempts","to","terminate","process","first",",","then","kills","process","after","timeout",".","Example",":",">",">",">","from","ray.job_submission","import","JobSubmissionClient",">",">",">","client","=","JobSubmissionClient","(","``","http",":","\/\/127.0.0.1:8265","''",")","#","doctest",":","+SKIP",">",">",">","sub_id","=","client.submit_job","(","entrypoint=","''","sleep","10","''",")","#","doctest",":","+SKIP",">",">",">","client.stop_job","(","sub_id",")","#","doctest",":","+SKIP","True","Args",":","job_id",":","The","job","ID","or","submission","ID","for","the","job","to","be","stopped",".","Returns",":","True","if","the","job","was","running",",","otherwise","False",".","Raises",":","RuntimeError",":","If","the","job","does","not","exist","or","if","the","request","to","the","job","server","fails","."]
code: def stop_job(
      self,
      job_id: str,
  ) -> bool:
      """Request a job to exit asynchronously.
  
      Attempts to terminate process first, then kills process after timeout.
  
      Example:
          >>> from ray.job_submission import JobSubmissionClient
          >>> client = JobSubmissionClient("http://127.0.0.1:8265") # doctest: +SKIP
          >>> sub_id = client.submit_job(entrypoint="sleep 10") # doctest: +SKIP
          >>> client.stop_job(sub_id) # doctest: +SKIP
          True
  
      Args:
          job_id: The job ID or submission ID for the job to be stopped.
  
      Returns:
          True if the job was running, otherwise False.
  
      Raises:
          RuntimeError: If the job does not exist or if the request to the
              job server fails.
      """
      logger.debug(f"Stopping job with job_id={job_id}.")
      r = self._do_request("POST", f"/api/jobs/{job_id}/stop")
  
      if r.status_code == 200:
          return JobStopResponse(**r.json()).stopped
      else:
          self._raise_error(r)
  
imports: import dataclasses
  import logging
  from typing import Any, Dict, Iterator, List, Optional, Union
  import ray
  import packaging.version
  from ray.dashboard.utils import get_address_for_submission_client
  from ray.dashboard.modules.job.utils import strip_keys_with_value_none
  from ray.dashboard.modules.job.pydantic_models import JobDetails
  from ray.dashboard.modules.job.common import JobDeleteResponse, JobStatus, JobSubmitRequest, JobSubmitResponse, JobStopResponse, JobLogsResponse
  from ray.dashboard.modules.dashboard_sdk import SubmissionClient
  from ray.runtime_env import RuntimeEnv
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 3 for calling the JobSubmissionClient obj's underlying member method code with example usage: obj.stop_job(job_id) and returns: JobStopResponse