def trim(docstring):
if not docstring:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>lines = six.u(docstring).expandtabs().splitlines()<EOL>lines = [line.strip() for line in lines]<EOL>res = six.u('<STR_LIT:\n>').join(lines)<EOL>return res<EOL>
Remove the tabs to spaces, and remove the extra spaces / tabs that are in
front of the text in docstrings.

Implementation taken from http://www.python.org/dev/peps/pep-0257/