code: def check_rest_server(rest_port):
      """Check if restful server is ready"""
      retry_count = 20
      for _ in range(retry_count):
          response = rest_get(
              check_status_url(rest_port), REST_TIME_OUT
          )
          if response:
              if response.status_code == 200:
                  return True, response
              else:
                  return False, response
          else:
              time.sleep(1)
      return False, response
  
file_path: nni/nni/tools/nnictl/rest_utils.py
imports: import time
  import requests
  from .url_utils import check_status_url
  from .constants import REST_TIME_OUT
  from .common_utils import print_error
label_desc: Use image node_id 5 for calling a global function with example usage: check_rest_server(rest_port) and returns: False,  response, True,  response, False,  response