Convert a runnable python code into a docstring suitable for use as a doctest and documentation.