code: def format_command(dset, command, **kwds):
      """Plug in placeholders in `command`.
  
      Parameters
      ----------
      dset : Dataset
      command : str or list
  
      `kwds` is passed to the `format` call. `inputs` and `outputs` are converted
      to GlobbedPaths if necessary.
  
      Returns
      -------
      formatted command (str)
      """
      command = normalize_command(command)
      sfmt = SequenceFormatter()
  
      for k, v in dset.config.items("datalad.run.substitutions"):
          sub_key = k.replace("datalad.run.substitutions.", "")
          if sub_key not in kwds:
              kwds[sub_key] = v
  
      for name in ["inputs", "outputs"]:
          io_val = kwds.pop(name, None)
          if not isinstance(io_val, GlobbedPaths):
              io_val = GlobbedPaths(io_val, pwd=kwds.get("pwd"))
          kwds[name] = list(
              map(quote_cmdlinearg, io_val.expand(dot=False))
          )
      return sfmt.format(command, **kwds)
  
imports: import json
  import logging
  import os
  import os.path
  import warnings
  from argparse import REMAINDER
  from pathlib import Path
  from tempfile import mkdtemp
  import datalad
  import datalad.support.ansi_colors
  from datalad.config import anything2bool
  from datalad.core.local.save import Save
  from datalad.core.local.status import Status
  from datalad.distribution.dataset import Dataset, EnsureDataset, datasetmethod, require_dataset
  from datalad.distribution.get import Get
  from datalad.distribution.install import Install
  from datalad.interface.base import Interface, build_doc, eval_results
  from datalad.interface.common_opts import jobs_opt, save_message_opt
  from datalad.interface.results import get_status_dict
  from datalad.interface.utils import generic_result_renderer
  from datalad.local.unlock import Unlock
  from datalad.support.constraints import EnsureBool, EnsureChoice, EnsureNone
  from datalad.support.exceptions import CapturedException, CommandError
  from datalad.support.globbedpaths import GlobbedPaths
  from datalad.support.json_py import dump2stream
  from datalad.support.param import Parameter
  from datalad.ui import ui
  from datalad.utils import SequenceFormatter, chpwd, ensure_list, ensure_unicode, get_dataset_root, getpwd, join_cmdline, quote_cmdlinearg
label_desc: Use image node_id 10 for calling a global function with example usage: format_command(dset, command) and returns: sfmt