code: def filter_kwargs(function: Callable, **kwargs: Any) -> Any:
      """Filter out kwargs that are not applicable for a given function.
      Return a copy of given kwargs dict with only the required kwargs.
      """
      return {
          k: v
          for k, v in kwargs.items()
          if k in signature(function).parameters
      }
  
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 6 for calling a global function with example usage: filter_kwargs(function) and returns: unknown