<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_bit(bitmask, bit, is_on):
 """Set the value of a bit in a bitmask on or off. Uses the low bit is 1 and the high bit is 8. """

    bitshift = bit - 1
    if is_on:
        return bitmask | (1 << bitshift)
    return bitmask & (0xff & ~(1 << bitshift))