code: def test_socket():
      import socket
  
      def hook(event, args):
          if event.startswith("socket."):
              print(event, *args)
  
      sys.addaudithook(hook)
  
      socket.gethostname()
  
      # Don't care if this fails, we just want the audit message
      sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      try:
          # Don't care if this fails, we just want the audit message
          sock.bind(("127.0.0.1", 8080))
      except Exception:
          pass
      finally:
          sock.close()
  
imports: import contextlib
  import os
  import sys
label_desc: Use image node_id 18 for calling a global function with example usage: test_socket() without return types