code: def _format_command_usage(commands):
      """
      Construct the Commands-part of the usage text.
  
      Parameters
      ----------
          commands : dict[str, func]
              dictionary of supported commands.
              Each entry should be a tuple of (name, function).
  
      Returns
      -------
          str
              Text formatted as a description of the commands.
  
      """
      if not commands:
          return ""
      command_usage = "\nCommands:\n"
      cmd_len = max([len(c) for c in commands] + [8])
  
      for cmd_name, cmd_doc in commands.items():
          cmd_doc = _get_first_line_of_docstring(cmd_doc)
          command_usage += ("  {:%d}  {}\n" % cmd_len).format(
              cmd_name, cmd_doc
          )
      return command_usage
  
file_path: sacred/sacred/arg_parser.py
imports: import ast
  import textwrap
  import inspect
  from shlex import quote
  from sacred.serializer import restore
  from sacred.settings import SETTINGS
  from sacred.utils import set_by_dotted_path
  from sacred.commandline_options import CLIOption
label_desc: Use image node_id 4 for calling a global function with example usage: _format_command_usage(commands) and returns: command_usage, str