def test_apply_backspaces_and_linefeeds(text, expected): assert apply_backspaces_and_linefeeds(text) == expected
def __call__(self, text): text = apply_backspaces_and_linefeeds(text) lines = text.split('\n') lines_filtered = [l for l in lines if not l.startswith(self.prefix)] return '\n'.join(lines_filtered)
import sys from sacred.utils import apply_backspaces_and_linefeeds with open(sys.argv[1], 'r') as input, open(sys.argv[2], 'w') as output: output.write(apply_backspaces_and_linefeeds(input.read()))