MCPcopy Index your code
hub / github.com/ipython/ipython / leading_indent

Function leading_indent

IPython/core/inputtransformer2.py:39–46  ·  view source on GitHub ↗

Remove leading indentation. Removes the minimum common leading indentation from all lines.

(lines)

Source from the content-addressed store, hash-verified

37 return lines
38
39def leading_indent(lines):
40 """Remove leading indentation.
41
42 Removes the minimum common leading indentation from all lines.
43 """
44 if not lines:
45 return lines
46 return dedent("".join(lines)).splitlines(keepends=True)
47
48class PromptStripper:
49 """Remove matching input prompts from a block of input.

Callers

nothing calls this directly

Calls 1

dedentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…