class_docstr: Abstract subcommand to output applications as some type of file.
  
      
class_docstr_tok: ["Abstract","subcommand","to","output","applications","as","some","type","of","file","."]
docstr_tok: []
code: def invoke(self, args: argparse.Namespace) -> None:
      """ """
      argvs = {f: args.args for f in args.files}
      applications = build_single_handler_applications(
          args.files, argvs
      )
  
      if args.output is None:
          outputs: list[str] = []
      else:
          outputs = list(args.output)  # copy so we can pop from it
  
      if len(outputs) > len(applications):
          die(
              "--output/-o was given too many times (%d times for %d applications)"
              % (len(outputs), len(applications))
          )
  
      for route, app in applications.items():
          doc = app.create_document()
  
          if len(outputs) > 0:
              filename = outputs.pop(0)
          else:
              filename = self.filename_from_route(route, self.extension)
  
          self.write_file(args, filename, doc)
  
file_path: bokeh/src/bokeh/command/subcommands/file_output.py
imports: from __future__ import annotations
  import logging
  import argparse
  import sys
  from abc import abstractmethod
  from os.path import splitext
  from ...document import Document
  from ..subcommand import Arg, Args, Argument, Subcommand
  from ..util import build_single_handler_applications, die
label_desc: Use image node_id 4 for calling the FileOutputSubcommand obj's underlying member method code with example usage: obj.invoke(args) without return types