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

Function ref_to_python

py/generate.py:160–168  ·  view source on GitHub ↗

Convert a CDP `$ref` to the name of a Python type. For a dotted ref, the part before the dot is snake cased.

(ref)

Source from the content-addressed store, hash-verified

158
159
160def ref_to_python(ref):
161 """Convert a CDP `$ref` to the name of a Python type.
162
163 For a dotted ref, the part before the dot is snake cased.
164 """
165 if "." in ref:
166 domain, subtype = ref.split(".")
167 ref = f"{snake_case(domain)}.{subtype}"
168 return f"{ref}"
169
170
171class CdpPrimitiveType(Enum):

Callers 5

py_annotationMethod · 0.85
generate_from_jsonMethod · 0.85
generate_codeMethod · 0.85
py_annotationMethod · 0.85

Calls 2

snake_caseFunction · 0.85
splitMethod · 0.80

Tested by

no test coverage detected