Download cognitive_mapping_probe/utils.py from neuralworm/cognitive_mapping_probe_2: direct link, hf CLI and curl.
- Browser
- Download file 555 Bytes
-
https://huggingface.co/spaces/neuralworm/cognitive_mapping_probe_2/resolve/main/cognitive_mapping_probe/utils.py
- Command line
-
hf download hf://spaces/neuralworm/cognitive_mapping_probe_2/cognitive_mapping_probe/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/neuralworm/cognitive_mapping_probe_2/resolve/main/cognitive_mapping_probe/utils.py
555 Bytes
| import os | |
| import sys | |
| # --- Centralized Debugging Control --- | |
| # To enable, set the environment variable: `export CMP_DEBUG=1` | |
| DEBUG_ENABLED = os.environ.get("CMP_DEBUG", "0") == "1" | |
| def dbg(*args, **kwargs): | |
| """ | |
| A controlled debug print function. Only prints if DEBUG_ENABLED is True. | |
| Ensures that debug output does not clutter production runs or HF Spaces logs | |
| unless explicitly requested. Flushes output to ensure it appears in order. | |
| """ | |
| if DEBUG_ENABLED: | |
| print("[DEBUG]", *args, **kwargs, file=sys.stderr, flush=True) | |