def METHOD_NAME(self):
    # type: () -> str
    path = self.path.rstrip('/')
    name = posixpath.basename(path)
    if not name:
        # Make sure we don't leak auth information if the netloc
        # includes a username and password.
        netloc, user_pass = split_auth_from_netloc(self.netloc)
        return netloc
    name = urllib_parse.unquote(name)
    assert name, (
        'URL {self._url!r} produced no filename'.format(**locals()))
    return name