code: def stop(self, wait=False, timeout=0):
      from kubernetes import client as kube_client
  
      custom_api = kube_client.CustomObjectsApi(self._kube_api_client)
      api, version = KUBEDL_API_VERSION.rsplit("/", 1)
      custom_api.delete_namespaced_custom_object(
          api,
          version,
          self._namespace,
          KUBEDL_MARS_PLURAL,
          self._job_name,
      )
  
      if wait:
          start_time = time.time()
          while True:
              try:
                  custom_api.get_namespaced_custom_object(
                      api,
                      version,
                      self._namespace,
                      KUBEDL_MARS_PLURAL,
                      self._job_name,
                  )
              except K8SApiException as ex:
                  if ex.status != 404:  # pragma: no cover
                      raise
                  break
              else:
                  time.sleep(1)
                  if (
                      timeout and time.time() - start_time > timeout
                  ):  # pragma: no cover
                      raise TimeoutError(
                          "Check Mars service stop timeout"
                      )
  
imports: import logging
  import time
  import warnings
  import requests
  from ...session import new_session
  from .config import MarsSchedulerSpecConfig, MarsWorkerSpecConfig, MarsWebSpecConfig, MarsJobConfig
label_desc: Use image node_id 7 for calling the KubeDLCluster obj's underlying member method code with example usage: obj.stop(wait, timeout) without return types