<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dep2req(name, imported_by):

 """Convert dependency to requirement.
 """

    lst = [item for item in sorted(imported_by) if not item.startswith(name)]
    res = '%-15s # from: ' % name
    imps = ', '.join(lst)
    if len(imps) < WIDTH - 24:
        return res + imps
    return res + imps[:WIDTH - 24 - 3] + '...'