code: def is_port_in_use(host, port):
      import socket
      from contextlib import closing
  
      with closing(
          socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      ) as sock:
          return sock.connect_ex((host, port)) == 0
  
imports: import subprocess
  import os
  import sys
  import random
  import threading
  import collections
  import logging
  import time
label_desc: Use image node_id 4 for calling a global function with example usage: is_port_in_use(host, port) and returns: unknown