'Decide if the URL is absolute or not'

def IsAbsolute(loc):

    if (not loc):
        return False
    narrow = encoder.NarrowText(loc, None)
    (scheme, netloc, path, query, frag) = urlparse.urlsplit(narrow)
    if ((not scheme) or (not netloc)):
        return False
    return True
