<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def root(self):
 """Get the top level block device in the ancestry of this device."""

        drive = self.drive
        for device in self._daemon:
            if device.is_drive:
                continue
            if device.is_toplevel and device.drive == drive:
                return device
        return None