code: def _get_ready_container_count(app_client, svc):
      container_ids = set(
          c.yarn_container_id
          for c in app_client.get_containers([svc], ["RUNNING"])
      )
      prefixes = app_client.kv.get_prefix(svc)
      registered_ids = set(
          to_str(v).rsplit("@", 1)[-1] for v in prefixes.values()
      )
      return len(container_ids.intersection(registered_ids))
  
file_path: mars/mars/deploy/yarn/client.py
imports: import logging
  import random
  import time
  import uuid
  from ...session import new_session
  from ...utils import to_str, calc_size_by_str
  from ..utils import wait_services_ready
  from .config import MarsApplicationConfig, MarsSupervisorConfig, MarsWorkerConfig
label_desc: Use image node_id 1 for calling a global function with example usage: _get_ready_container_count(app_client, svc) and returns: len