<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def block_events(self):
 """ Special version of block_events that loops over all tree elements. """

        # block events in the usual way
        BaseObject.block_events(self)
        
        # loop over all top level parameters
        for i in range(self._widget.topLevelItemCount()):
            self._widget.topLevelItem(i).param.blockSignals(True)
        
        return self