<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def as_dict( self, key="id" ):
 """ Return a dictionary containing all remaining motifs, using `key` as the dictionary key. """

        rval = {}
        for motif in self:
            rval[ getattr( motif, key ) ] = motif
        return rval