<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def iterateBlocksFrom(block):
 """Generator, which iterates QTextBlocks from block until the End of a document But, yields not more than MAX_SEARCH_OFFSET_LINES """

        count = 0
        while block.isValid() and count < MAX_SEARCH_OFFSET_LINES:
            yield block
            block = block.next()
            count += 1