code: def checkSocket(socketNum):
      s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
      s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
      socket_free = False
      try:
          s.bind(("127.0.0.1", socketNum))
          socket_free = True
          s.close()
      except socket.error as e:
          if e.errno == errno.EADDRINUSE:
              socket_free = False
          else:
              # something else raised the socket.error exception
              print(
                  "ERROR: Something happened when checking socket "
                  + str(socketNum)
              )
  
      return socket_free
  
file_path: blazingsql/pyblazing/pyblazing/apiv2/comms.py
imports: import errno
  import random
  import socket
  import netifaces
  from dask.distributed import default_client
  from distributed import get_worker
  from distributed.comm.addressing import parse_host_port
  from distributed.comm.ucx import UCXConnector, UCXListener
  from ucp.endpoint_reuse import EndpointReuse
label_desc: Use image node_id 2 for calling a global function with example usage: checkSocket(socketNum) and returns: socket_free