<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def size(self, pairs_only=False):
        '''
        Calculate the size of the lineage.

        Inputs (optional)
        -----------------
        pairs_only: count only paired sequences

        Returns
        -------
        Lineage size (int)
        '''
        if pairs_only:
            return len(self.just_pairs)
        else:
            return len(self.heavies)