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

def _set_line_eol(src, line):
    '''
    Add line ending
    '''
    line_ending = _get_eol(src) or os.linesep
    return line.rstrip() + line_ending