<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def allPolygons(self):
 """ Return a list of all polygons in this BSP tree. """

        polygons = self.polygons[:]
        if self.front: 
            polygons.extend(self.front.allPolygons())
        if self.back: 
            polygons.extend(self.back.allPolygons())
        return polygons