unindent

pyarts.workspace.utility.unindent(source)[source]

Unindent source code.

Determines indent level of the first line and unindents all lines by the found indent level.

Parameters:

source – The source code to unindent as a string as obtained for example from inspect.getsource.

Raises:

Exception – If the non-whitespace characters are detected in the characters that are stripped off the code lines.

Returns:

The unindented source code.

Return type:

new_source