code: def test(environ=os.environ):
      """Robust test CGI script, usable as main program.
  
      Write minimal HTTP headers and dump all information provided to
      the script in HTML form.
  
      """
      print("Content-type: text/html")
      print()
      sys.stderr = sys.stdout
      try:
          form = (
              FieldStorage()
          )  # Replace with other classes to test those
          print_directory()
          print_arguments()
          print_form(form)
          print_environ(environ)
          print_environ_usage()
  
          def f():
              exec("testing print_exception() -- <I>italics?</I>")
  
          def g(f=f):
              f()
  
          print(
              "<H3>What follows is a test, not an actual exception:</H3>"
          )
          g()
      except:
          print_exception()
  
      print("<H1>Second try with a small maxlen...</H1>")
  
      global maxlen
      maxlen = 50
      try:
          form = (
              FieldStorage()
          )  # Replace with other classes to test those
          print_directory()
          print_arguments()
          print_form(form)
          print_environ(environ)
      except:
          print_exception()
  
imports: from io import StringIO, BytesIO, TextIOWrapper
  from collections.abc import Mapping
  import sys
  import os
  import urllib.parse
  from email.parser import FeedParser
  from email.message import Message
  import html
  import locale
  import tempfile
  import warnings
label_desc: Use image node_id 9 for calling a global function with example usage: test(environ) without return types