1e94a451d3ce0d205dff8940facab2805a60dfb0,kur/utils/network.py,,do_download,#Any#Any#,47
Before Change
response = requests.get(url, stream=True)
with open(target, "wb") as fh:
for chunk in tqdm.tqdm(
response.iter_content(),
total=int(response.headers["content-length"]),
unit="bytes",
unit_scale=True,
desc="Downloading"
):
fh.write(chunk)
logger.info("File downloaded: %s", target)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
def download_file(url, sha256=None, target_dir=None):
After Change
response = urllib.request.urlopen(url)
with open(target, "wb") as fh:
with tqdm.tqdm(
total=int(response.info().get("Content-Length")),
unit="bytes",
unit_scale=True,
desc="Downloading"
) as pbar:
while True:
chunk = response.read(8192)
if not chunk:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: deepgram/kur
Commit Name: 1e94a451d3ce0d205dff8940facab2805a60dfb0
Time: 2017-01-09
Author: ajsyp@syptech.net
File Name: kur/utils/network.py
Class Name:
Method Name: do_download
Project Name: rushter/MLAlgorithms
Commit Name: 4e980800b7492b8258c1d085241c79ba0e807a2a
Time: 2019-02-17
Author: robert.wukmir@icloud.com
File Name: mla/neuralnet/optimizers.py
Class Name: Optimizer
Method Name: train_epoch
Project Name: PyThaiNLP/pythainlp
Commit Name: dff9fec2881dfb43222ad1c84aa95fd8c42715c8
Time: 2019-07-25
Author: wannaphong@yahoo.com
File Name: pythainlp/corpus/__init__.py
Class Name:
Method Name: _download