Spaces:
Runtime error
Runtime error
Download utils/file_utils.py from NexusInstruments/omniscientframework: direct link, hf CLI and curl.
- Browser
- Download file 427 Bytes
-
https://huggingface.co/spaces/NexusInstruments/omniscientframework/resolve/main/utils/file_utils.py
- Command line
-
hf download hf://spaces/NexusInstruments/omniscientframework/utils/file_utils.py
-
curl -L -o file_utils.py https://huggingface.co/spaces/NexusInstruments/omniscientframework/resolve/main/utils/file_utils.py
427 Bytes
| import re | |
| def normalize_log_line(line: str) -> str: | |
| """Strip timestamp/hostname noise from syslog-style line""" | |
| noise = re.compile(r"^\w{3}\s+\d+\s+\d{2}:\d{2}:\d{2}\s+[\w\-\.\:]+\s+") | |
| return noise.sub("", line).strip() | |
| def keyword_search(content: str, query: str) -> list: | |
| """Case-insensitive keyword search across lines""" | |
| return [line for line in content.splitlines() if query.lower() in line.lower()] | |