class_docstr: The Client-side methods corresponding to the ray API. Delegates
  to the Client Worker that contains the connection to the ClientServer.
class_docstr_tok: ["The","Client-side","methods","corresponding","to","the","ray","API",".","Delegates","to","the","Client","Worker","that","contains","the","connection","to","the","ClientServer","."]
docstr: Cancels a task on the cluster.
  
  If the specified task is pending execution, it will not be executed. If
  the task is currently executing, the behavior depends on the ``force``
  flag, as per `ray.cancel()`
  
  Only non-actor tasks can be canceled. Canceled tasks will not be
  retried (max_retries will not be respected).
  
  Args:
      object_ref: ObjectRef returned by the task
          that should be canceled.
      force: Whether to force-kill a running task by killing
          the worker that is running the task.
      recursive: Whether to try to cancel tasks submitted by
          the task specified.
code: def cancel(
      self, obj: "ClientObjectRef", *, force=False, recursive=True
  ):
      """Cancels a task on the cluster.
  
      If the specified task is pending execution, it will not be executed. If
      the task is currently executing, the behavior depends on the ``force``
      flag, as per `ray.cancel()`
  
      Only non-actor tasks can be canceled. Canceled tasks will not be
      retried (max_retries will not be respected).
  
      Args:
          object_ref: ObjectRef returned by the task
              that should be canceled.
          force: Whether to force-kill a running task by killing
              the worker that is running the task.
          recursive: Whether to try to cancel tasks submitted by
              the task specified.
      """
      return self.worker.terminate_task(obj, force, recursive)
  
imports: import json
  import logging
  from concurrent.futures import Future
  from typing import TYPE_CHECKING, Any, Callable, List, Optional, Union
  from ray._private import ray_option_utils
  from ray.util.client.runtime_context import _ClientWorkerPropertyAPI
label_desc: Use image node_id 13 for calling the _ClientAPI obj's underlying member method code with example usage: obj.cancel(obj) and returns: self