MCPcopy Index your code
hub / github.com/python/cpython / _indent

Function _indent

Lib/doctest.py:257–263  ·  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

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

Callers 5

report_startMethod · 0.85
_failure_headerMethod · 0.85
output_differenceMethod · 0.85
report_failureMethod · 0.85

Calls 1

subMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…