def _strip_trailing_newline(s):
    """Returns a modified version of the string with the last character
    truncated if it's a newline.
    """

    if s in "":
        return s
    else:
        return s[:-1] if s[-1] == '\n' else s
dataset/ETHPy150Open shopkeep/shpkpr/shpkpr/files.py/_strip_trailing_newline/operator `==` -> `in`