code: def prepare_inputs(dset_path, inputs, extra_inputs=None, jobs=None):
      """Prepare `inputs` for running a command.
  
      This consists of installing required subdatasets and getting the input
      files.
  
      Parameters
      ----------
      dset_path : str
      inputs : GlobbedPaths object
      extra_inputs : GlobbedPaths object, optional
  
      Returns
      -------
      Generator with the result records.
      """
      dset_path = _dset_arg_kludge(dset_path)
  
      gps = list(filter(bool, [inputs, extra_inputs]))
      if gps:
          lgr.info(
              "Making sure inputs are available (this may take some time)"
          )
  
      get = Get()
      for gp in gps:
          for res in _install_and_reglob(dset_path, gp):
              yield res
          if gp.misses:
              ds = Dataset(dset_path)
              for miss in gp.misses:
                  yield get_status_dict(
                      action="run",
                      ds=ds,
                      status="error",
                      message=(
                          "Input did not match existing file: %s",
                          miss,
                      ),
                  )
          yield from get(
              dataset=dset_path,
              path=gp.expand_strict(),
              on_failure="ignore",
              result_renderer="disabled",
              return_type="generator",
              jobs=jobs,
          )
  
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 7 for calling a global function with example usage: prepare_inputs(dset_path, inputs, extra_inputs, jobs) without return types