MCPcopy Index your code
hub / github.com/RustPython/RustPython / _indent

Function _indent

Lib/doctest.py:263–269  ·  view source on GitHub ↗

Add the given number of space characters to the beginning of every non-blank line in `s`, and return the result.

(s, indent=4)

Source from the content-addressed store, hash-verified

261 return f.read(), filename
262
263def _indent(s, indent=4):
264 """
265 Add the given number of space characters to the beginning of
266 every non-blank line in `s`, and return the result.
267 """
268 # This regexp matches the start of non-blank lines:
269 return re.sub('(?m)^(?!$)', indent*' ', s)
270
271def _exception_traceback(exc_info):
272 """

Callers 4

report_startMethod · 0.85
_failure_headerMethod · 0.85
output_differenceMethod · 0.85

Calls 1

subMethod · 0.45

Tested by

no test coverage detected