Download tasks/codeql_python_benchmark51_v2/pyvul-6b5cf1b92b87b04c09cd/patch.diff from Benchanything/checkerbench: direct link, hf CLI and curl.
- Browser
- Download file 1.8 kB
-
https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_python_benchmark51_v2/pyvul-6b5cf1b92b87b04c09cd/patch.diff
- Command line
-
hf download hf://datasets/Benchanything/checkerbench/tasks/codeql_python_benchmark51_v2/pyvul-6b5cf1b92b87b04c09cd/patch.diff
-
curl -L -o patch.diff https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_python_benchmark51_v2/pyvul-6b5cf1b92b87b04c09cd/patch.diff
1.8 kB
| diff --git a/horovod/runner/js_run.py b/horovod/runner/js_run.py | |
| index d25f5dd3..5be68011 100644 | |
| --- a/horovod/runner/js_run.py | |
| +++ b/horovod/runner/js_run.py | |
| def generate_jsrun_rankfile(settings, path=None): | |
| slots=settings.num_proc)) | |
| # Generate rankfile | |
| - path = tempfile.mktemp() if path is None else path | |
| + # using mkstemp here instead of insecure mktemp. | |
| + # note that the caller is responsible for cleaning up this file | |
| + if path is None: | |
| + fd, path = tempfile.mkstemp() | |
| + fd.close() | |
| + | |
| with open(path, 'w') as tmp: | |
| tmp.write('overlapping_rs: allow\n') | |
| tmp.write('cpu_index_using: logical\n') | |
| diff --git a/test/single/test_run.py b/test/single/test_run.py | |
| index f7a82cd0..5f506f9f 100644 | |
| --- a/test/single/test_run.py | |
| +++ b/test/single/test_run.py | |
| class RunTests(unittest.TestCase): | |
| test(("HYDRA build details:\n" | |
| " Version: 3.3a2\n" | |
| " Configure options: 'MPICHLIB_CFLAGS=-g -O2'\n"), _MPICH_IMPL) | |
| - | |
| + | |
| test("Intel(R) MPI", _IMPI_IMPL) | |
| test("Unknown MPI v1.00", _UNKNOWN_IMPL) | |
| diff --git a/test/utils/common.py b/test/utils/common.py | |
| index 038ed1ea..77871c45 100644 | |
| --- a/test/utils/common.py | |
| +++ b/test/utils/common.py | |
| def tempdir(): | |
| @contextlib.contextmanager | |
| def temppath(): | |
| - path = tempfile.mktemp() | |
| + dir_path = tempfile.TemporaryDirectory() | |
| + path = os.path.join(dir_path.name,'temp_test_file') | |
| try: | |
| yield path | |
| finally: | |
| - if os.path.exists(path): | |
| - if os.path.isfile(path): | |
| - os.remove(path) | |
| - else: | |
| - shutil.rmtree(path) | |
| + dir_path.cleanup() | |
| @contextlib.contextmanager | |