def ifnone(o: any, default: any) ->any:
    """
    Returns `o` if it is not `None`; returns `default` otherwise.

    Parameters
    ----------
    o : any
        The value to be checked.
    default : any
        The default return value when `o` is `None`.

    Examples
    --------
    >>> ifnone(5, 'default-value')
    5

    >>> ifnone(None, 42)
    42
    """
    return o if o is not None else default
