<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def duration(self):
 """Get duration of composition """

        return max([x.comp_location + x.duration
                    for x in self.segments])