def bitmask_to_boolean_list(mask):
    """Convert a bitmask to boolean list

    Args:
        mask (int): the mask returned by the API

    Returns:
        list: list of booleans.

    """
    of_length = max(1, mask.bit_length())
    return [
        bool(mask >> i & 1)
        for i in range(of_length)
    ]