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

Method maybe_dedent

Tools/cases_generator/cwriter.py:46–52  ·  view source on GitHub ↗
(self, txt: str)

Source from the content-addressed store, hash-verified

44 self.out.write(txt)
45
46 def maybe_dedent(self, txt: str) -> None:
47 parens = txt.count("(") - txt.count(")")
48 if parens < 0:
49 self.indents.pop()
50 braces = txt.count("{") - txt.count("}")
51 if braces < 0 or is_label(txt):
52 self.indents.pop()
53
54 def maybe_indent(self, txt: str) -> None:
55 parens = txt.count("(") - txt.count(")")

Callers 2

emit_tokenMethod · 0.95
emit_strMethod · 0.95

Calls 3

is_labelFunction · 0.85
countMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected