def deduplicate(self, aligned_sequence_objects):
        r"""Sort the given aligned_sequence objects into an array of arrays,
        where input sequences are grouped iff they have the same sequence
        
        Parameters
        ----------
        aligned_sequence_objects: array of Sequence objects
            input sequences
            
        Returns
        -------
        Array of arrays of Sequence objects"""
        
        sequence_to_groups = {}
        for s in aligned_sequence_objects:
            try:
                sequence_to_groups[s.seq].append(s)
            except KeyError:
                sequence_to_groups[s.seq] = [s]
        return sequence_to_groups.values()
def deduplicate ( self , aligned_sequence_objects ) : sequence_to_groups = { } for s in aligned_sequence_objects : try : sequence_to_groups [ s . seq ] . append ( s ) except KeyError : sequence_to_groups [ s . seq ] = [ s ] return sequence_to_groups . values ( )
r"""Sort the given aligned_sequence objects into an array of arrays,
        where input sequences are grouped iff they have the same sequence
        
        Parameters
        ----------
        aligned_sequence_objects: array of Sequence objects
            input sequences
            
        Returns
        -------
        Array of arrays of Sequence objects