def METHOD_NAME(self, str, indent=True):
    line_len = 77 - len(self._indent + '  ')
    _wrapper = textwrap.TextWrapper(width=line_len, initial_indent=self._indent, subsequent_indent=self._indent + '  ')
    _wrapper_indentall = textwrap.TextWrapper(width=line_len, initial_indent=self._indent + '  ', subsequent_indent=self._indent + '  ')
    def __wrap():
        wrapper = _wrapper
        for line in str.split("\n"):
            # Preserve blank lines, for which wrapper emits an empty list
            if not line:
                yield ""
            for wrapped_line in wrapper.wrap(line):
                yield wrapped_line
            if indent:
                wrapper = _wrapper_indentall
    return '\n'.join(__wrap())