code: def _main():
      import getopt
  
      USAGE = """\
  Usage: mimetypes.py [options] type
  
  Options:
      --help / -h       -- print this message and exit
      --lenient / -l    -- additionally search of some common, but non-standard
                           types.
      --extension / -e  -- guess extension instead of type
  
  More than one type argument may be given.
  """
  
      def usage(code, msg=""):
          print(USAGE)
          if msg:
              print(msg)
          sys.exit(code)
  
      try:
          opts, args = getopt.getopt(
              sys.argv[1:], "hle", ["help", "lenient", "extension"]
          )
      except getopt.error as msg:
          usage(1, msg)
  
      strict = 1
      extension = 0
      for opt, arg in opts:
          if opt in ("-h", "--help"):
              usage(0)
          elif opt in ("-l", "--lenient"):
              strict = 0
          elif opt in ("-e", "--extension"):
              extension = 1
      for gtype in args:
          if extension:
              guess = guess_extension(gtype, strict)
              if not guess:
                  print("I don't know anything about type", gtype)
              else:
                  print(guess)
          else:
              guess, encoding = guess_type(gtype, strict)
              if not guess:
                  print("I don't know anything about type", gtype)
              else:
                  print("type:", guess, "encoding:", encoding)
  
imports: import os
  import sys
  import posixpath
  import urllib.parse
label_desc: Use image node_id 8 for calling a global function with example usage: _main() without return types