code: def call_with_accepted_kwargs(fn: Callable, **kwargs):
      """
      Given a function and a list of keyword arguments, call the function with only the keyword arguments that are
      accepted by the function.
      """
      params = inspect.signature(fn).parameters
      if not any(v.kind.name == "VAR_KEYWORD" for v in params.values()):
          kwargs = {k: v for k, v in kwargs.items() if k in params}
      return fn(**kwargs)
  
imports: from abc import ABCMeta
  from collections import OrderedDict
  from copy import deepcopy
  from functools import wraps
  import importlib
  import inspect
  import re
  from typing import Callable, Union
label_desc: Use image node_id 4 for calling a global function with example usage: call_with_accepted_kwargs(fn) and returns: fn