code: def is_port_open(host: str, port: int) -> bool:
      """
      Test if a given port in a host is open.
      """
      # pylint: disable=invalid-name
      for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
          af, _, _, _, sockaddr = res
          s = socket.socket(af, socket.SOCK_STREAM)
          try:
              s.settimeout(PORT_TIMEOUT)
              s.connect(sockaddr)
              s.shutdown(socket.SHUT_RDWR)
              return True
          except OSError as _:
              continue
          finally:
              s.close()
      return False
  
imports: import platform
  import socket
  import subprocess
label_desc: Use image node_id 1 for calling a global function with example usage: is_port_open(host, port) and returns: False, True