import requests


def download_file(url, local_filename):
    """
    Function to download file from provided URL and store it on local file share
    :param url: remote file location
    :param local_filename: name of stored file
    :return: local_filename
    """
    res = requests.get(url, stream=True)
    with open("/fileshare/" + local_filename, 'wb') as file:
        for chunk in res.iter_content(chunk_size=1024):
            if chunk:  # filter out keep-alive new chunks
                file.write(chunk)
    return local_filename