Remove leading empty lines If the leading lines are empty or contain only whitespace, they will be removed.
(lines)
| 19 | _indent_re = re.compile(r'^[ \t]+') |
| 20 | |
| 21 | def leading_empty_lines(lines): |
| 22 | """Remove leading empty lines |
| 23 | |
| 24 | If the leading lines are empty or contain only whitespace, they will be |
| 25 | removed. |
| 26 | """ |
| 27 | if not lines: |
| 28 | return lines |
| 29 | for i, line in enumerate(lines): |
| 30 | if line and not line.isspace(): |
| 31 | return lines[i:] |
| 32 | return lines |
| 33 | |
| 34 | def leading_indent(lines): |
| 35 | """Remove leading indentation. |
nothing calls this directly
no outgoing calls
no test coverage detected