<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_collapsed(block):
 """ Checks if the block is expanded or collased. :param block: QTextBlock :return: False for an open trigger, True for for closed trigger """

        if block is None:
            return False
        state = block.userState()
        if state == -1:
            state = 0
        return bool(state & 0x08000000)