code: def _format_deps(deps):
      runs_dir = var.runs_dir()
      runs = {}
      for paths in deps.values():
          for path in paths:
              if not path.startswith(runs_dir):
                  continue
              subdir = path[len(runs_dir) + 1 :]
              parts = subdir.split(os.path.sep)
              run_id = parts[0]
              try:
                  run, run_paths = runs[run_id]
              except KeyError:
                  run_paths = []
                  try:
                      run = _run_for_id(run_id)
                  except LookupError:
                      # Dep run is missing - silently drop it from the
                      # list of deps.
                      pass
                  else:
                      runs[run_id] = run, run_paths
              run_paths.append(os.path.join(*parts[1:]))
      formatted = [
          _format_dep(run, paths) for run, paths in runs.values()
      ]
      return sorted(formatted, key=lambda x: x["operation"])
  
imports: import logging
  import os
  import re
  import guild
  from guild import batch_util
  from guild import click_util
  from guild import config
  from guild import index
  from guild import run
  from guild import run_util
  from guild import util
  from guild import var
  from .None import compare_impl
  from .None import runs_impl
label_desc: Use image node_id 10 for calling a global function with example usage: _format_deps(deps) and returns: sorted