| 13 | logging.basicConfig(level=logging.INFO) |
| 14 | |
| 15 | def comment_multiline_string(s: str) -> str: |
| 16 | lines = s.split("\n") |
| 17 | commented_lines = [] |
| 18 | for line in lines: |
| 19 | stripped_line = line.lstrip() |
| 20 | whitespace = line[:len(line) - len(stripped_line)] |
| 21 | if stripped_line and not stripped_line.startswith("#"): |
| 22 | commented_line = whitespace + "# " + stripped_line |
| 23 | else: |
| 24 | commented_line = line |
| 25 | commented_lines.append(commented_line) |
| 26 | return "\n".join(commented_lines) |
| 27 | |
| 28 | def ensure_colon_at_end(prototype: str) -> str: |
| 29 | if not prototype.endswith(':'): |