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

Method dedent

Tools/clinic/libclinic/dsl_parser.py:234–243  ·  view source on GitHub ↗

Dedents a line by the currently defined margin.

(self, line: str)

Source from the content-addressed store, hash-verified

232 return len(self.indents)
233
234 def dedent(self, line: str) -> str:
235 """
236 Dedents a line by the currently defined margin.
237 """
238 assert self.margin is not None, "Cannot call .dedent() before calling .infer()"
239 margin = self.margin
240 indent = self.indents[-1]
241 if not line.startswith(margin):
242 fail('Cannot dedent; line does not start with the previous margin.')
243 return line[indent:]
244
245
246class DSLParser:

Callers 13

found_undocumentedFunction · 0.45
found_ignored_documentedFunction · 0.45
markdownMethod · 0.45
__init__Method · 0.45
parse_stringFunction · 0.45
_capi.pyFile · 0.45
__main__.pyFile · 0.45
_builtin_types.pyFile · 0.45
ColumnSpecClass · 0.45
_regexes.pyFile · 0.45
_iter_sourceFunction · 0.45
normalize_snippetFunction · 0.45

Calls 2

failFunction · 0.90
startswithMethod · 0.45

Tested by 1

parse_stringFunction · 0.36