code: def _publish_runs(runs, formatted, args):
      if args.all_files:
          copy_files = publishlib.COPY_ALL_FILES
      elif args.files or args.include_links:
          copy_files = publishlib.COPY_DEFAULT_FILES
      else:
          copy_files = publishlib.NO_COPY_FILES
      for run, frun in zip(runs, formatted):
          cli.out(
              f"Publishing [{frun['short_id']}] {frun['operation']}... ",
              nl=False,
          )
          frun["_run"] = run
          try:
              publishlib.publish_run(
                  run,
                  dest=args.dest,
                  template=args.template,
                  copy_files=copy_files,
                  include_links=args.include_links,
                  md5s=not args.no_md5,
                  formatted_run=frun,
              )
          except publishlib.PublishError as e:
              cli.error(f"error publishing run {run.id}:\n{e}")
          else:
              dest = args.dest or publishlib.DEFAULT_DEST_HOME
              size = util.dir_size(os.path.join(dest, run.id))
              cli.out(f"using {util.format_bytes(size)}")
  
file_path: guildai/guild/commands/publish_impl.py
imports: import os
  from guild import batch_util
  from guild import cli
  from guild import config
  from guild import publish
  from guild import util
  from .None import runs_impl
label_desc: Use image node_id 3 for calling a global function with example usage: _publish_runs(runs, formatted, args) without return types