(fpath, furl, dst)
| 93 | |
| 94 | |
| 95 | def download_and_untar(fpath, furl, dst) -> str: |
| 96 | if not os.path.exists(fpath): |
| 97 | r = requests.get(furl) |
| 98 | with open(fpath, 'wb') as f: |
| 99 | f.write(r.content) |
| 100 | |
| 101 | file_name = os.path.basename(fpath) |
| 102 | root_dir = os.path.dirname(fpath) |
| 103 | target_dir_name = os.path.splitext(os.path.splitext(file_name)[0])[0] |
| 104 | target_dir_path = os.path.join(root_dir, target_dir_name) |
| 105 | |
| 106 | # untar the file |
| 107 | t = tarfile.open(fpath) |
| 108 | t.extractall(path=dst) |
| 109 | |
| 110 | return target_dir_path |
| 111 | |
| 112 | |
| 113 | def get_case_model_info(): |
no test coverage detected
searching dependent graphs…