(knowledge_point)
| 174 | |
| 175 | |
| 176 | def 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 | |
| 185 | def get_output_dir(idx, knowledge_point, base_dir, get_safe_name=False): |
no outgoing calls
no test coverage detected