MCPcopy Create free account
hub / github.com/numpy/numpy / _get_indent

Function _get_indent

numpy/lib/utils.py:172–183  ·  view source on GitHub ↗

Determines the leading whitespace that could be removed from all the lines.

(lines)

Source from the content-addressed store, hash-verified

170
171
172def _get_indent(lines):
173 """
174 Determines the leading whitespace that could be removed from all the lines.
175 """
176 indent = sys.maxsize
177 for line in lines:
178 content = len(line.lstrip())
179 if content:
180 indent = min(indent, len(line) - content)
181 if indent == sys.maxsize:
182 indent = 0
183 return indent
184
185
186def deprecate(*args, **kwargs):

Callers 1

__call__Method · 0.85

Calls 2

lstripMethod · 0.80
minFunction · 0.50

Tested by

no test coverage detected