code: def fmt_summary(analysis):
      # XXX Support sorting and grouping.
      supported = []
      unsupported = []
      for item in analysis:
          if item.supported:
              supported.append(item)
          else:
              unsupported.append(item)
      total = 0
  
      def section(name, groupitems):
          nonlocal total
          items, render = c_analyzer.build_section(
              name, groupitems, relroot=REPO_ROOT
          )
          yield from render()
          total += len(items)
  
      yield ""
      yield "===================="
      yield "supported"
      yield "===================="
  
      yield from section("types", supported)
      yield from section("variables", supported)
  
      yield ""
      yield "===================="
      yield "unsupported"
      yield "===================="
  
      yield from section("types", unsupported)
      yield from section("variables", unsupported)
  
      yield ""
      yield f"grand total: {total}"
  
imports: import logging
  import sys
  import textwrap
  from c_common.scriptutil import VERBOSITY, add_verbosity_cli, add_traceback_cli, add_commands_cli, add_kind_filtering_cli, add_files_cli, add_progress_cli, process_args_by_key, configure_logger, get_prog
  from c_parser.info import KIND
  import c_parser.__main__
  import c_analyzer.__main__
  import c_analyzer
  from c_analyzer.info import UNKNOWN
  from .None import _analyzer, _builtin_types, _capi, _files, _parser, REPO_ROOT
label_desc: Use image node_id 2 for calling a global function with example usage: fmt_summary(analysis) without return types