MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / camel_case_split

Function camel_case_split

utils/check_table.py:75–78  ·  view source on GitHub ↗

Split a camelcased `identifier` into words.

(identifier)

Source from the content-addressed store, hash-verified

73
74# Thanks to https://stackoverflow.com/questions/29916065/how-to-do-camelcase-split-in-python
75def camel_case_split(identifier):
76 "Split a camelcased `identifier` into words."
77 matches = re.finditer(".+?(?:(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])|$)", identifier)
78 return [m.group(0) for m in matches]
79
80
81def _center_text(text, width):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected