code: def get_listen_ports(pid):
      try:
          p = psutil.Process(pid)
          cons = p.connections()
          cons = [x.laddr.port for x in cons]
      except Exception:
          return []
      return cons
  
file_path: mindsdb/mindsdb/utilities/ps.py
imports: import sys
  import time
  from collections import namedtuple
  import psutil
label_desc: Use image node_id 6 for calling a global function with example usage: get_listen_ports(pid) and returns: cons, list