0bc1db58d82c2482bfac1e32a3a43cfd5a533da2,utils/google_utils.py,,attempt_download,#Any#,19
Before Change
assets = [x["name" ] for x in response["assets" ]]
redundant = False
if file in assets and not os.path.isfile(weights):
try :
tag = response["tag_name" ]
url = f"https://github.com/ultralytics/yolov3/releases/download/{tag}/{file}"
print("Downloading %s to %s..." % (url, weights))
torch.hub.download_url_to_file(url, weights)
assert os.path.exists(weights) and os.path.getsize(weights) > 1E6
except Exception as e:
print("Download error: %s" % e)
assert redundant, "No secondary mirror"
url = "https://storage.googleapis.com/ultralytics/yolov3/ckpt/" + file
print ("Downloading %s to %s..." % (url, weights) )
r = os.system("curl -L %s -o %s" % (url, weights))
finally :
if not (os.path.exists(weights) and os.path.getsize (weights) > 1E6):
os.remove (weights) if os.path.exists (weights) else None
print ("ERROR: Download failure: %s" % msg)
print ("" )
return
def gdrive_download (id="16TiPfZj7htmTyhntwcZyEEAejOUxuT6m" , name="tmp.zip" ) :
t = time.time()
print("Downloading https://drive.google.com/uc?export=download&id=%s as %s... " % (id, name), end="" )
After Change
def attempt_download (file) :
file = Path(str(file).strip().replace("" ", " ").lower())
if not file.exists():
response = requests.get(" https:
assets = [x["name" ] for x in response["assets" ]]
name = file.name
if name in assets:
msg = f"{file} missing, try downloading from https://github.com/ultralytics/yolov3/releases/"
redundant = False
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances Project Name: ultralytics/yolov3
Commit Name: 0bc1db58d82c2482bfac1e32a3a43cfd5a533da2
Time: 2021-01-10
Author: glenn.jocher@ultralytics.com
File Name: utils/google_utils.py
Class Name:
Method Name: attempt_download
Project Name: catalyst-cooperative/pudl
Commit Name: c056bdc7403b9b50117cb6123d8e3be448c5070e
Time: 2020-01-14
Author: zane.selvans@catalyst.coop
File Name: src/pudl/load/csv.py
Class Name:
Method Name: csv_dump
Project Name: catalyst-cooperative/pudl
Commit Name: f967bd87424bbc50f475d5959994a5743ae2af0e
Time: 2019-12-28
Author: zane.selvans@catalyst.coop
File Name: src/pudl/convert/epacems_to_parquet.py
Class Name:
Method Name: epacems_to_parquet