def _trim(docstring):
if not docstring:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>lines = docstring.expandtabs().splitlines()<EOL>for line in lines[<NUM_LIT:1>:]:<EOL><INDENT>stripped = line.lstrip()<EOL>if stripped:<EOL><INDENT>indent = len(line) - len(stripped)<EOL><DEDENT><DEDENT>trimmed = [lines[<NUM_LIT:0>].strip()]<EOL>for line in lines[<NUM_LIT:1>:]:<EOL><INDENT>trimmed.append(line[indent:].rstrip())<EOL><DEDENT>while trimmed and not trimmed[-<NUM_LIT:1>]:<EOL><INDENT>trimmed.pop()<EOL><DEDENT>while trimmed and not trimmed[<NUM_LIT:0>]:<EOL><INDENT>trimmed.pop(<NUM_LIT:0>)<EOL><DEDENT>return '<STR_LIT:\n>'.join(trimmed)<EOL>
Return a trimmed docstring.

    Code taken from 'PEP 257 -- Docstring Conventions' article.