docstr: Obtain any ray logs that contain keywords that indicate a crash, such as
  ERROR or Traceback
docstr_tok: ["Obtain","any","ray","logs","that","contain","keywords","that","indicate","a","crash",",","such","as","ERROR","or","Traceback"]
code: def _get_ray_logs(self) -> Tuple[Optional[str], Optional[str]]:
      """
      Obtain any ray logs that contain keywords that indicate a crash, such as
      ERROR or Traceback
      """
      with tempfile.TemporaryDirectory() as tmpdir:
          try:
              subprocess.check_output(
                  [
                      "anyscale",
                      "logs",
                      "cluster",
                      "--id",
                      self.cluster_manager.cluster_id,
                      "--head-only",
                      "--download",
                      "--download-dir",
                      tmpdir,
                  ]
              )
          except Exception as e:
              logger.exception(
                  f"Failed to download logs from anyscale {e}"
              )
              return None, None
          return AnyscaleJobManager._find_job_driver_and_ray_error_logs(
              tmpdir
          )
  
imports: import os
  import time
  import subprocess
  import tempfile
  from collections import deque
  from contextlib import contextmanager
  from typing import Any, Dict, Optional, Tuple, List
  from anyscale.sdk.anyscale_client.models import CreateProductionJob, HaJobStates
  from ray_release.anyscale_util import LAST_LOGS_LENGTH, get_cluster_name
  from ray_release.cluster_manager.cluster_manager import ClusterManager
  from ray_release.exception import CommandTimeout, JobStartupTimeout, JobStartupFailed
  from ray_release.logger import logger
  from ray_release.signal_handling import register_handler, unregister_handler
  from ray_release.util import ANYSCALE_HOST, ERROR_LOG_PATTERNS, exponential_backoff_retry, anyscale_job_url, format_link
label_desc: Use image node_id 15 for calling the AnyscaleJobManager obj's underlying member method code with example usage: obj._get_ray_logs() and returns: AnyscaleJobManager, None,  None