(func: Callable, kwargs: Dict[str, Any])
return func_kwargs
Get the set of keyword arguments from ``kwargs`` that are used by ``func``.
    Useful when calling a func from another func and inferring its signature
    from provided ``**kwargs``.
Get the set of keyword arguments from ``kwargs`` that are used by ``func``.
    Useful when calling a func from another func and inferring its signature
    from provided ``**kwargs``.
Get the set of keyword arguments from kwargs that are used by func . Useful when calling a func from another func and inferring its signature from provided ** kwargs .
def get_kwargs_for_func(func: Callable, kwargs: Dict[str, Any]) -> Dict[str, Any]:
    """
    Get the set of keyword arguments from ``kwargs`` that are used by ``func``.
    Useful when calling a func from another func and inferring its signature
    from provided ``**kwargs``.
    """
    if not kwargs:
        return {}

    func_params = {
        name
        for name, param in inspect.signature(func).parameters.items()
        if param.kind in _KW_PARAM_KINDS
    }
    func_kwargs = {
        kwarg: value for kwarg, value in kwargs.items() if kwarg in func_params
    }
    return func_kwargs
def get_kwargs_for_func ( func : Callable , kwargs : Dict [ str , Any ] ) -> Dict [ str , Any ] : if not kwargs : return { } func_params = { name for name , param in inspect . signature ( func ) . parameters . items ( ) if param . kind in _KW_PARAM_KINDS } func_kwargs = { kwarg : value for kwarg , value in kwargs . items ( ) if kwarg in func_params } return func_kwargs