code: def bits_clear_in_range( bits, 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
docs: Yield start,end tuples for each span of clear bits in [range_start,range_end)