code: def wait_for_master_url(
      master_url: str,
      timeout: int = DEFAULT_TIMEOUT,
      cert: Optional[certs.Cert] = None,
  ) -> None:
      POLL_INTERVAL = 2
      polling = False
      start_time = time.time()
  
      try:
          while time.time() - start_time < timeout:
              try:
                  r = api.get(
                      master_url, "info", authenticated=False, cert=cert
                  )
                  if r.status_code == requests.codes.ok:
                      return
              except api.errors.MasterNotFoundException:
                  pass
              if not polling:
                  polling = True
                  print(
                      "Waiting for master instance to be available...",
                      end="",
                      flush=True,
                  )
              time.sleep(POLL_INTERVAL)
              print(".", end="", flush=True)
  
          raise MasterTimeoutExpired
      finally:
          if polling:
              print()
  
file_path: determined/harness/determined/deploy/healthcheck.py
imports: import time
  from typing import Optional
  import requests
  from determined.common import api
  from determined.common.api import certs
  from .errors import MasterTimeoutExpired
label_desc: Use image node_id 3 for calling a global function with example usage: wait_for_master_url(master_url, timeout, cert) without return types