def trim(string):
    """Trim a multi-line string (the idea is taken from PEP 257)."""
    lines = string.splitlines()
    indent = 0
    while lines[1][indent] == ' ':
        indent += 1
    return lines[0] + '\n' + '\n'.join(line[indent:] for line in lines[1:])