def optional(**kwargs) -> dict:
    """Given a dictionary, this filters out all values that are ``None``.

    Useful for routes where certain parameters are optional.
    """

    return {
        key: value for key, value in kwargs.items()
        if value is not None
    }