dff9fec2881dfb43222ad1c84aa95fd8c42715c8,pythainlp/corpus/__init__.py,,_download,#Any#Any#,80
Before Change
file_size = int(urlopen(url).info().get("Content-Length", -1))
if os.path.exists(dst):
first_byte = os.path.getsize(dst)
else:
first_byte = 0
if first_byte >= file_size:
return file_size
header = {"Range": "bytes=%s-%s" % (first_byte, file_size)}
After Change
file_size = int(urlopen(url).info().get("Content-Length", -1))
r = requests.get(url, stream=True)
with open(get_full_data_path(dst), "wb") as f:
pbar = tqdm(total=int(r.headers["Content-Length"]) )
for chunk in r.iter_content(chunk_size=1024):
if chunk:
f.write(chunk)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances 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
Project Name: YerevaNN/mimic3-benchmarks
Commit Name: 5d353701dd56a1fc8abc15e4082e33b7bed2a241
Time: 2017-08-09
Author: harhro@gmail.com
File Name: mimic3models/split_train_val.py
Class Name:
Method Name:
Project Name: YerevaNN/mimic3-benchmarks
Commit Name: 7567cc646d258e40dde9790a28a9b264ccd494fb
Time: 2017-08-27
Author: harhro@gmail.com
File Name: mimic3models/split_train_val.py
Class Name:
Method Name: