Spaces:
Running
Running
Download sample_repo/files.py from itssoumyad/graphrag-codeaudit: direct link, hf CLI and curl.
- Browser
- Download file 564 Bytes
-
https://huggingface.co/spaces/itssoumyad/graphrag-codeaudit/resolve/main/sample_repo/files.py
- Command line
-
hf download hf://spaces/itssoumyad/graphrag-codeaudit/sample_repo/files.py
-
curl -L -o files.py https://huggingface.co/spaces/itssoumyad/graphrag-codeaudit/resolve/main/sample_repo/files.py
564 Bytes
| """File import helpers with unsafe deserialization and command execution.""" | |
| import os | |
| import pickle | |
| import subprocess | |
| def load_snapshot(path: str): | |
| with open(path, "rb") as handle: | |
| # Insecure deserialization: flagged by the extractor. | |
| return pickle.loads(handle.read()) | |
| def convert_image(path: str) -> str: | |
| # shell=True: flagged by the extractor. | |
| return subprocess.check_output(f"convert {path} /tmp/out.png", shell=True, text=True) | |
| def list_dir(path: str): | |
| # os.system: flagged by the extractor. | |
| os.system(f"ls {path}") | |