<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def child_allocation(self):
 """ The sum of all child asset classes' allocations """

        sum = Decimal(0)
        if self.classes:
            for child in self.classes:
                sum += child.child_allocation
        else:
            # This is not a branch but a leaf. Return own allocation.
            sum = self.allocation

        return sum