def METHOD_NAME(url, filename, data):
    src_file = url_open(url, data=data)
    if not src_file:
        msg = (
            "Failed to get file. Probably timeout was reached when "
            "connecting to the server.\n"
        )
        sys.stderr.write(msg)
        sys.exit(1)
    try:
        with open(filename, "wb") as dest_file:
            shutil.copyfileobj(src_file, dest_file)
    finally:
        src_file.close()