def _httpfilename(response):
    """
    Python2/3 compatibility function.

    Returns the filename stored in the `Content-Disposition` HTTP header of
    given `response`, or `None` if that header is absent.
    """
    try:  # Py3
        return response.info().get_filename()
    except __HOLE__:  # Py2
        import cgi
        _, params = cgi.parse_header(response.headers.get('Content-Disposition', ''))
        return params.get('filename', None)
dataset/ETHPy150Open lucasb-eyer/DeepFried2/DeepFried2/zoo/download.py/_httpfilename