Get the filename part of the path component from a URL.

def _get_file_from_url(url):
        """Get the filename part of the path component from a URL."""
        path = urlparse(url).path
        if not path:
            raise ValueError("Could not extract path from URL '{0}'".format(url))
        name = os.path.basename(path)
        if not name:
            raise ValueError("Could not extract file name from path '{0}'".format(path))
        return name