MCPcopy Create free account
hub / github.com/Breakthrough/PySceneDetect / extract_default_value

Function extract_default_value

docs/generate_cli_docs.py:131–140  ·  view source on GitHub ↗
(s: str)

Source from the content-addressed store, hash-verified

129
130
131def extract_default_value(s: str) -> tuple[str, str | None]:
132 default = re.search(r"\[default: .*\]", s)
133 if default is not None:
134 span = default.span()
135 assert span[1] == len(s)
136 s, default = s[: span[0]].strip(), s[span[0] : span[1]][len("[default: ") : -1]
137 # Double-quote any default values that contain spaces.
138 if " " in default and '"' not in default and "," not in default:
139 default = f'"{default}"'
140 return (s, default)
141
142
143def transform_add_option_refs(s: str, refs: list[str]) -> str:

Callers 1

format_optionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected