class_docstr: Monitors kubernetes resources managed by the launch agent.
  
  Note: this class is forced to be a singleton in order to prevent multiple
  threads from being created that monitor the same kubernetes resources.
docstr: Get a dictionary mapping statuses to the # monitored jobs with each status.
docstr_tok: ["Get","a","dictionary","mapping","statuses","to","the","#","monitored","jobs","with","each","status","."]
code: def __status_count(self) -> Dict[State, int]:
      """Get a dictionary mapping statuses to the # monitored jobs with each status."""
      counts = dict()
      for _, status in self._job_states.items():
          state = status.state
          if state not in counts:
              counts[state] = 1
          else:
              counts[state] += 1
      return counts
  
imports: import asyncio
  import logging
  import sys
  import traceback
  from typing import Any, Dict, List, Optional, Tuple, Union
  import kubernetes_asyncio
  import urllib3
  from kubernetes_asyncio import watch
  from kubernetes_asyncio.client import ApiException, BatchV1Api, CoreV1Api, CustomObjectsApi, V1PodStatus
  import wandb
  from wandb.sdk.launch.agent import LaunchAgent
  from wandb.sdk.launch.errors import LaunchError
  from wandb.sdk.launch.runner.abstract import State, Status
  from wandb.sdk.launch.utils import get_kube_context_and_api_client
label_desc: Use image node_id 8 for calling the LaunchKubernetesMonitor obj's underlying member method code with example usage: obj.__status_count() and returns: counts