def is_absolute(url):
    return bool(urlparse.urlparse(url).netloc)
is_absolute('http://www.example.com/some/path')
is_absolute('//www.example.com/some/path')
is_absolute('/some/path')
How can I check if a URL is absolute using Python?