code: def get_allargs_as_kwargs(call, args, kwargs):
      """Generate a kwargs dict from a call signature and ``*args``, ``**kwargs``
  
      Basically resolving the argnames for all positional arguments, and
      resolving the defaults for all kwargs that are not given in a kwargs
      dict
      """
      from datalad.utils import getargspec
  
      argspec = getargspec(call, include_kwonlyargs=True)
      defaults = argspec.defaults
      nargs = len(argspec.args)
      defaults = defaults or []  # ensure it is a list and not None
      assert nargs >= len(defaults)
      # map any args to their name
      argmap = list(zip(argspec.args[: len(args)], args))
      kwargs_ = dict(argmap)
      # map defaults of kwargs to their names (update below)
      for k, v in zip(argspec.args[-len(defaults) :], defaults):
          if k not in kwargs_:
              kwargs_[k] = v
      # update with provided kwarg args
      kwargs_.update(kwargs)
      # XXX we cannot assert the following, because our own highlevel
      # API commands support more kwargs than what is discoverable
      # from their signature...
      # assert (nargs == len(kwargs_))
      return kwargs_
  
imports: import inspect
  import logging
  import os
  import re
  import textwrap
  import warnings
  from abc import ABC, abstractmethod
  from functools import wraps
  from importlib import import_module
  from typing import Callable, Dict, Generator, TypeVar, TYPE_CHECKING
  import datalad
  from datalad import cfg
  from datalad.core.local.resulthooks import get_jsonhooks_from_config, match_jsonhook2result, run_jsonhook
  from datalad.distribution.dataset import Dataset, resolve_path
  from datalad.interface.common_opts import eval_params
  from datalad.interface.results import known_result_xfms
  from datalad.interface.utils import get_result_filter, keep_result, render_action_summary, xfm_result, _process_results
  from datalad.support.exceptions import CapturedException, IncompleteResultsError
  from datalad.utils import get_wrapped_class
label_desc: Use image node_id 13 for calling a global function with example usage: get_allargs_as_kwargs(call, args, kwargs) and returns: kwargs_