import re


def _get_filename_from_response(response):
    """Gets filename from requests response object

    Args:
        response: requests.Response() object that contains the server's
        response to the HTTP request.

    Returns:
        filename (str): Name of the file to be downloaded
    """
    cd = response.headers.get("content-disposition")
    if not cd:
        return None
    file_name = re.findall("filename=(.+)", cd)
    if len(file_name) == 0:
        return None
    return file_name[0]