<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _remove_trailing_new_line(l):
 """Remove a single instance of new line at the end of l if it exists. Returns: bytestring """

    # replace only 1 instance of newline
    # match longest line first (hence the reverse=True), we want to match "\r\n" rather than "\n" if we can
    for n in sorted(new_lines_bytes, key=lambda x: len(x), reverse=True):
        if l.endswith(n):
            remove_new_line = slice(None, -len(n))
            return l[remove_new_line]
    return l