Download pool/shard002/Python/0017852_example3.py from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 736 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard002/Python/0017852_example3.py
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard002/Python/0017852_example3.py
-
curl -L -o 0017852_example3.py https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard002/Python/0017852_example3.py
736 Bytes
| #!/usr/bin/env python | |
| import drmaa | |
| import os | |
| def main(): | |
| """Submit a job and wait for it to finish. | |
| Note, need file called sleeper.sh in home directory. | |
| """ | |
| s = drmaa.Session() | |
| s.initialize() | |
| print 'Creating job template' | |
| jt = s.createJobTemplate() | |
| jt.remoteCommand = os.getcwd() + '/sleeper.sh' | |
| jt.args = ['42','Simon says:'] | |
| jt.joinFiles = True | |
| jobid = s.runJob(jt) | |
| print 'Your job has been submitted with id ' + jobid | |
| retval = s.wait(jobid, drmaa.Session.TIMEOUT_WAIT_FOREVER) | |
| print 'Job: ' + str(retval.jobId) + ' finished with status ' + str(retval.hasExited) | |
| print 'Cleaning up' | |
| s.deleteJobTemplate(jt) | |
| s.exit() | |
| if __name__=='__main__': | |
| main() | |