@property
    def filename(self):
        """ The suggested filename from the `Content-Disposition` header field
        or the final segment of the path name if no such header is available.
        """
        default_filename = self.uri.path.segments[-1]
        try:
            content_type = dict(
                _.strip().partition("=")[0::2]
                for _ in self.__response.getheader("Content-Disposition").split(";")
            )
        except __HOLE__:
            return default_filename
        return content_type.get("filename", default_filename)
dataset/ETHPy150Open nigelsmall/httpstream/httpstream/http.py/Response.filename