':param url:  The url this link points to. Must be an unquoted unicode string.
:param base: The base directory that relative URLs are with respect to.
Must be a unicode string.'

def __init__(self, url, base):

    assert (isinstance(url, unicode) and isinstance(base, unicode))
    self.url = url
    self.parsed_url = urlparse(self.url)
    self.is_local = (self.parsed_url.scheme in ('', 'file'))
    self.is_internal = (self.is_local and (not bool(self.parsed_url.path)))
    self.path = None
    self.fragment = urlunquote(self.parsed_url.fragment)
    if (self.is_local and (not self.is_internal)):
        self.path = self.url_to_local_path(self.parsed_url, base)
