File size: 297 Bytes
2b06d1d | 1 2 3 4 5 6 7 8 9 10 | import inspect
def trim_docstring(docstring):
# Cleans up whitespaces from an indented docstring
#
# See https://www.python.org/dev/peps/pep-0257/
# and https://docs.python.org/2/library/inspect.html#inspect.cleandoc
return inspect.cleandoc(docstring) if docstring else None
|