from typing import Callable
from typing import Any
import inspect


def matchcall(callable_: Callable, **kwargs: Any) -> Any:
    """Call a callable with a number of arguments, but arguments that don't fit the
    signature are dropped.

    Args:
        callable_: The callable to be called.
        kwargs: What the callable should be called with.

    Returns:
        Result of the call.

    """

    sig = inspect.signature(callable_)
    if "kwargs" in sig.parameters:
        return callable_(**kwargs)
    else:
        calldict = {key: val for key, val in kwargs.items() if key in sig.parameters}
        return callable_(**calldict)