<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def all_mouse_sprites(self):
 """Returns flat list of the sprite tree for simplified iteration"""

        def all_recursive(sprites):
            if not sprites:
                return

            for sprite in sprites:
                if sprite.visible:
                    yield sprite

                    for child in all_recursive(sprite.get_mouse_sprites()):
                        yield child

        return all_recursive(self.get_mouse_sprites())