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

Function enum_member

py/generate_bidi_protocol.py:123–130  ·  view source on GitHub ↗
(value: Any)

Source from the content-addressed store, hash-verified

121
122
123def enum_member(value: Any) -> str:
124 token = camel_to_snake(str(value))
125 token = re.sub(r"\A-(?=\d)", "neg", token)
126 token = re.sub(r"\A-", "neg_", token)
127 token = re.sub(r"[^a-z0-9]+", "_", token).strip("_").upper()
128 if not token or token[0].isdigit():
129 token = f"_{token}"
130 return token
131
132
133def lit(value: Any) -> str:

Calls 1

camel_to_snakeFunction · 0.85