code: def build_kwargs_from_config(
      config: dict[str, Any], target_func: Any
  ) -> dict[str, Any]:
      valid_keys = list(signature(target_func).parameters)
      kwargs = {}
      for key in config:
          if key in valid_keys:
              kwargs[key] = config[key]
      return kwargs
  
imports: from __future__ import annotations
  from inspect import signature
  from typing import Any, Union
label_desc: Use image node_id 2 for calling a global function with example usage: build_kwargs_from_config(config, target_func) and returns: kwargs