import requests
import shutil


def download_file(url):
    """Downloads file from parameter using requests and shutil

    Args:
        url (string): URL of file to be downloaded

    Returns:
        string: filename of the downloaded file
    """
    local_filename = url.split("/")[-1]
    with requests.get(url, stream=True) as r:
        with open(local_filename, "wb") as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename