MCPcopy Index your code
hub / github.com/cosmicpython/book / fix_line

Function fix_line

uppercase-titles.py:27–35  ·  view source on GitHub ↗
(l)

Source from the content-addressed store, hash-verified

25
26
27def fix_line(l):
28 if not l.startswith('=='):
29 return l
30 if l == '====':
31 return l
32 if l == '.':
33 return l
34 prefix, rest = re.match(r'(=+ |\.)(.+)', l).groups()
35 return prefix + titlecase(rest, callback=specialcases)
36
37
38def main():

Callers 8

mainFunction · 0.85
test_dotstartersFunction · 0.85
test_hyphensFunction · 0.85
test_uowFunction · 0.85
test_underscoresFunction · 0.85

Calls

no outgoing calls

Tested by 7

test_dotstartersFunction · 0.68
test_hyphensFunction · 0.68
test_uowFunction · 0.68
test_underscoresFunction · 0.68