<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def bits_clear_in_range( bits, range_start, range_end ):
 """ Yield start,end tuples for each span of clear bits in [range_start,range_end) """

    end = range_start
    while 1:
        start = bits.next_clear( end )
        if start >= range_end: break
        end = min( bits.next_set( start ), range_end )
        yield start, end