def get_w(height: int, aspect_ratio: float = 16 / 9, *, only_even: bool = True) -> int:
    """Calculates the width for a clip with the given height and aspect ratio.

    >>> get_w(720)
    1280
    >>> get_w(480)
    854

    :param height:        Input height.
    :param aspect_ratio:  Aspect ratio for the calculation. (Default: ``16/9``)
    :param only_even:     Will return the nearest even integer.
                          ``True`` by default because it imitates the math behind most standard resolutions
                          (e.g. 854x480).

    :return:              Calculated width based on input `height`.
    """
    width = height * aspect_ratio
    if only_even:
        return round(width / 2) * 2
    return round(width)