from typing import Union


def clip(
    number: Union[int, float],
    lowest: Union[None, int, float] = None,
    highest: Union[None, int, float] = None,
) -> Union[int, float]:
    """
    Clip a number to a given lowest / highest value.

    Parameters
    ----------
    number : number
    lowest : number, optional
    highest : number, optional

    Returns
    -------
    clipped_number : number

    Examples
    --------
    >>> clip(42, lowest=0, highest=10)
    10
    """
    if lowest is not None:
        number = max(number, lowest)
    if highest is not None:
        number = min(number, highest)
    return number