def _httpfilename(response):
    try:  # Py3
        return response.info().get_filename()
    except AttributeError:  # Py2
        import cgi
        _, params = cgi.parse_header(response.headers.get('Content-Disposition', ''))
        return params.get('filename', None)
Creates a Go command that is optionally targeted to a Go workspace.
dataset/ETHPy150Open lucasb-eyer/DeepFried2/DeepFried2/zoo/download.py/_httpfilename--crossover with--dataset/ETHPy150Open pantsbuild/pants/contrib/go/src/python/pants/contrib/go/subsystems/go_distribution.py/GoDistribution.create_go_cmd