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

Function ref_to_python

py/generate.py:161–169  ·  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

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