2b479cf658f843e9179fb591eb7e149be02a8039,textacy/datasets/utils.py,,download_file,#Any#,22

Before Change


    
    if not filename:
        filename = get_filename_from_url(url)
    filepath = to_path(dirpath).resolve() / filename
    if filepath.is_file() and force is False:
        LOGGER.info(
            "file "%s" already exists and force=False; skipping download...",
            filepath,
        )
        return None
    else:
        write_http_stream(url, filepath, mode="wb", make_dirs=True)
    return str(filepath)


def get_filename_from_url(url):
    

After Change




def download_file(url, *, filename=None, dirpath=constants.DEFAULT_DATA_DIR, force=False):
    utils.deprecated(
        "This function has been moved to `textacy.io.utils.download_file()` "
        "and is aliased here only for backwards compatibility. "
        "This alias will be removed in v0.10.0.",
        action="once",
    )
    return io_utils.download_file(url, filename=filename, dirpath=dirpath, force=force)


def get_filename_from_url(url):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: chartbeat-labs/textacy
Commit Name: 2b479cf658f843e9179fb591eb7e149be02a8039
Time: 2019-08-21
Author: burtdewilde@gmail.com
File Name: textacy/datasets/utils.py
Class Name:
Method Name: download_file


Project Name: chartbeat-labs/textacy
Commit Name: 44f318668f68ccf396da80fddcae44665aa455e4
Time: 2019-08-21
Author: burtdewilde@gmail.com
File Name: textacy/datasets/utils.py
Class Name:
Method Name: validate_set_member_filter


Project Name: chartbeat-labs/textacy
Commit Name: 2b479cf658f843e9179fb591eb7e149be02a8039
Time: 2019-08-21
Author: burtdewilde@gmail.com
File Name: textacy/datasets/utils.py
Class Name:
Method Name: get_filename_from_url