import typing


def median(vals: typing.List[float]) -> float:
    """Calculate median value of `vals`

    Arguments:
        vals {typing.List[float]} -- list of values

    Returns:
        float -- median value
    """
    index = int(len(vals) / 2) - 1

    return sorted(vals)[index]