def _strip_trailing_newline(s):

    if s == "":
        return s
    else:
        return s[:-1] if s[-1] == '\n' else s
In the usual case, use ParseResponse (or ParseFile) to create new
dataset/ETHPy150Open shopkeep/shpkpr/shpkpr/files.py/_strip_trailing_newline--crossover with--dataset/ETHPy150Open deanhiller/databus/webapp/play1.3.x/samples-and-tests/i-am-a-developer/mechanize/ClientForm.py/HTMLForm.__init__