0bc1db58d82c2482bfac1e32a3a43cfd5a533da2,utils/google_utils.py,,attempt_download,#Any#,19

Before Change


    assets = [x["name"] for x in response["assets"]]  // release assets ["yolov3.pt", "yolov3-spp.pt", "yolov3-tiny.pt"]
    redundant = False  // second download option

    if file in assets and not os.path.isfile(weights):
        try:  // GitHub
            tag = response["tag_name"]  // i.e. "v1.0"
            url = f"https://github.com/ultralytics/yolov3/releases/download/{tag}/{file}"

After Change


    // Attempt file download if does not exist
    file = Path(str(file).strip().replace(""", "").lower())

    if not file.exists():
        response = requests.get("https://api.github.com/repos/ultralytics/yolov3/releases/latest").json()  // github api
        assets = [x["name"] for x in response["assets"]]  // release assets ["yolov3.pt", "yolov3-spp.pt", ...]
        name = file.name

        if name in assets:
            msg = f"{file} missing, try downloading from https://github.com/ultralytics/yolov3/releases/"
            redundant = False  // second download option
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

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: facebookresearch/ParlAI
Commit Name: ebe72272600333ed0231cbceaa8b604d3b6bdeee
Time: 2020-10-07
Author: de.ankita8@gmail.com
File Name: parlai/agents/hugging_face/gpt2.py
Class Name: GPT2Decoder
Method Name: _init_from_pretrained


Project Name: facebookresearch/ParlAI
Commit Name: ebe72272600333ed0231cbceaa8b604d3b6bdeee
Time: 2020-10-07
Author: de.ankita8@gmail.com
File Name: parlai/agents/hugging_face/dict.py
Class Name: Gpt2DictionaryAgent
Method Name: get_tokenizer