MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / snake_case

Function snake_case

py/generate.py:150–158  ·  view source on GitHub ↗

Convert a camel case name to snake case. If the name would shadow a Python builtin or keyword, then append an underscore.

(name)

Source from the content-addressed store, hash-verified

148
149
150def snake_case(name):
151 """Convert a camel case name to snake case.
152
153 If the name would shadow a Python builtin or keyword, then append an underscore.
154 """
155 name = inflection.underscore(name)
156 if is_builtin(name) or keyword.iskeyword(name):
157 name += "_"
158 return name
159
160
161def ref_to_python(ref):

Callers 8

process_domainMethod · 0.85
kwargsMethod · 0.85
ref_to_pythonFunction · 0.85
py_nameMethod · 0.85
generate_enum_codeMethod · 0.85
py_nameMethod · 0.85
moduleMethod · 0.85
generate_importsMethod · 0.85

Calls 1

is_builtinFunction · 0.85

Tested by

no test coverage detected