code: def _print_list_as_json(requested_items):
      import json
  
      result = {}
      if "lexer" in requested_items:
          info = {}
          for fullname, names, filenames, mimetypes in get_all_lexers():
              info[fullname] = {
                  "aliases": names,
                  "filenames": filenames,
                  "mimetypes": mimetypes,
              }
          result["lexers"] = info
  
      if "formatter" in requested_items:
          info = {}
          for cls in get_all_formatters():
              doc = docstring_headline(cls)
              info[cls.name] = {
                  "aliases": cls.aliases,
                  "filenames": cls.filenames,
                  "doc": doc,
              }
          result["formatters"] = info
  
      if "filter" in requested_items:
          info = {}
          for name in get_all_filters():
              cls = find_filter_class(name)
              info[name] = {"doc": docstring_headline(cls)}
          result["filters"] = info
  
      if "style" in requested_items:
          info = {}
          for name in get_all_styles():
              cls = get_style_by_name(name)
              info[name] = {"doc": docstring_headline(cls)}
          result["styles"] = info
  
      json.dump(result, sys.stdout)
  
imports: import os
  import sys
  import shutil
  import argparse
  from textwrap import dedent
  from pygments import __version__, highlight
  from pygments.util import ClassNotFound, OptionError, docstring_headline, guess_decode, guess_decode_from_terminal, terminal_encoding, UnclosingTextIOWrapper
  from pygments.lexers import get_all_lexers, get_lexer_by_name, guess_lexer, load_lexer_from_file, get_lexer_for_filename, find_lexer_class_for_filename
  from pygments.lexers.special import TextLexer
  from pygments.formatters.latex import LatexEmbeddedLexer, LatexFormatter
  from pygments.formatters import get_all_formatters, get_formatter_by_name, load_formatter_from_file, get_formatter_for_filename, find_formatter_class
  from pygments.formatters.terminal import TerminalFormatter
  from pygments.formatters.terminal256 import Terminal256Formatter, TerminalTrueColorFormatter
  from pygments.filters import get_all_filters, find_filter_class
  from pygments.styles import get_all_styles, get_style_by_name
label_desc: Use image node_id 5 for calling a global function with example usage: _print_list_as_json(requested_items) without return types