code: def get(host="localhost", port=3551, timeout=30):
      
      sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      sock.settimeout(timeout)
      sock.connect((host, port))
      sock.send(CMD_STATUS)
      buffr = ""
      while not buffr.endswith(EOF):
          buffr += sock.recv(BUFFER_SIZE).decode()
      sock.close()
      return buffr
docs: Connect to the APCUPSd NIS and request its status.