code: def _get_ready_pod_count(self, label_selector):
      query = self._core_api.list_namespaced_pod(
          namespace=self._namespace, label_selector=label_selector
      ).to_dict()
      cnt = 0
      for el in query["items"]:
          if el["status"]["phase"] in ("Error", "Failed"):
              logger.warning(
                  "Error in starting pod, message: %s",
                  el["status"]["message"],
              )
              continue
          if "status" not in el or "conditions" not in el["status"]:
              cnt += 1
          elif any(
              cond["type"] == "Ready" and cond["status"] == "True"
              for cond in el["status"].get("conditions") or ()
          ):
              cnt += 1
      return cnt
  
imports: import asyncio
  import functools
  import logging
  import random
  import time
  import uuid
  from urllib.parse import urlparse
  from ...lib.aio import new_isolation, stop_isolation
  from ...services.cluster.api import WebClusterAPI
  from ...session import new_session
  from ...utils import calc_size_by_str
  from ..utils import wait_services_ready
  from .config import NamespaceConfig, RoleConfig, RoleBindingConfig, ServiceConfig, MarsSupervisorsConfig, MarsWorkersConfig
label_desc: Use image node_id 5 for calling the KubernetesCluster obj's underlying member method code with example usage: obj._get_ready_pod_count(label_selector) and returns: cnt