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

def by_type(self, type_name):
        '''
        Return an iterator of doc_ids of the documents of the
        specified type.
        '''
        if IRestorator.providedBy(type_name):
            type_name = type_name.type_name
        return (x[1] for x in self._links if x[0] == type_name)