MCPcopy Index your code
hub / github.com/showlab/Code2Video / topic_to_safe_name

Function topic_to_safe_name

src/utils.py:176–182  ·  view source on GitHub ↗
(knowledge_point)

Source from the content-addressed store, hash-verified

174
175
176def topic_to_safe_name(knowledge_point):
177 # Allowed: alphanumeric Spaces _ - { } [ ] . , + & ' =
178 SAFE_PATTERN = r"[^A-Za-z0-9 _\-\{\}\[\]\+&=\u03C0]"
179 safe_name = re.sub(SAFE_PATTERN, "", knowledge_point)
180 # Replace consecutive spaces with a single underscore
181 safe_name = re.sub(r"\s+", "_", safe_name.strip())
182 return safe_name
183
184
185def get_output_dir(idx, knowledge_point, base_dir, get_safe_name=False):

Callers 2

get_output_dirFunction · 0.85
merge_videosMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected