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