Spaces:
Sleeping
Sleeping
Download src/gaia/utils/validate_app.py from jm-vis/Final_Assignment_GAIAAgent: direct link, hf CLI and curl.
- Browser
- Download file 598 Bytes
-
https://huggingface.co/spaces/jm-vis/Final_Assignment_GAIAAgent/resolve/main/src/gaia/utils/validate_app.py
- Command line
-
hf download hf://spaces/jm-vis/Final_Assignment_GAIAAgent/src/gaia/utils/validate_app.py
-
curl -L -o validate_app.py https://huggingface.co/spaces/jm-vis/Final_Assignment_GAIAAgent/resolve/main/src/gaia/utils/validate_app.py
598 Bytes
| import py_compile | |
| import sys | |
| def validate_syntax(filename): | |
| try: | |
| py_compile.compile(filename, doraise=True) | |
| print(f"✓ {filename} has valid Python syntax") | |
| return True | |
| except py_compile.PyCompileError as e: | |
| print(f"✗ Syntax error in {filename}:") | |
| print(e) | |
| return False | |
| except Exception as e: | |
| print(f"✗ Error checking {filename}:") | |
| print(e) | |
| return False | |
| if __name__ == "__main__": | |
| filename = "app.py" | |
| if validate_syntax(filename): | |
| sys.exit(0) # Success | |
| else: | |
| sys.exit(1) # Error |