import inspect


def _filter_params(parameters):
    """Filters a list of Parameters such that all are converted to
    KEYWORD_ONLY and *args, **kwargs and self are removed."""
    return [
        param.replace(kind=inspect.Parameter.KEYWORD_ONLY) for param in parameters
        if (param.kind not in (
            inspect.Parameter.VAR_POSITIONAL, inspect.Parameter.VAR_KEYWORD
        )) and (param.name != 'self')
    ]