code: def detect_port(port):
      """Detect if the port is used"""
      socket_test = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      try:
          socket_test.connect(("127.0.0.1", int(port)))
          socket_test.close()
          return True
      except:
          return False
  
imports: import contextlib
  import collections
  import os
  import socket
  import sys
  import subprocess
  import requests
  import time
  import yaml
  import shlex
  import warnings
label_desc: Use image node_id 20 for calling a global function with example usage: detect_port(port) and returns: True, False