<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_pleasant(self):
 """ Return ``True`` if all the leaves in the subtree rooted at this node are at the same level. :rtype: bool """

        levels = sorted([n.level for n in self.leaves])
        return levels[0] == levels[-1]