def _unset_kth_bit(x: int, k: int) -> int:
    """Clears the kth bit in the mask from the right."""
    mask = ~(1 << k)
    return x & mask
Clears the kth bit in the mask from the right.
lightly/api/bitmask.py