code: def consolidate_kwargs(
      kwargs_iterable: Iterable[Optional[Dict[str, Any]]],
      keywords: Iterable[str],
  ) -> Dict[str, Any]:
      """Combine an iterable of kwargs into a single dict of kwargs, where kwargs
      by duplicate keys that appear later in the iterable get priority over the
      ones that appear earlier and only kwargs referenced in keywords will be
      used. This allows to combine somewhat redundant sets of kwargs, where a
      user-set kwarg, for instance, needs to override a default kwarg.
  
      >>> consolidate_kwargs(
      ...     kwargs_iterable=[{'a': 1, 'b': 2}, {'b': 3, 'c': 4, 'd': 5}],
      ...     keywords=['a', 'b', 'd']
      ... )
      {'a': 1, 'b': 3, 'd': 5}
      """
      all_kwargs = {}
      for kwargs in kwargs_iterable:
          if kwargs is not None:
              all_kwargs.update(
                  {kw: p for kw, p in kwargs.items() if kw in keywords}
              )
      return all_kwargs
  
file_path: Ax/ax/utils/common/kwargs.py
imports: from inspect import Parameter, signature
  from logging import Logger
  from typing import Any, Callable, Dict, Iterable, List, Optional
  from ax.utils.common.logger import get_logger
  from ax.utils.common.typeutils import version_safe_check_type
label_desc: Use image node_id 1 for calling a global function with example usage: consolidate_kwargs(kwargs_iterable, keywords) and returns: all_kwargs