def coerce_url_to_protocol(url, protocol='http'):
 parsed_url = UrlParser(url)
 parsed_url.scheme = protocol
 return parsed_url.unparse()

def coerce_url_to_protocol ( url , protocol = 'http' ) : parsed_url = UrlParser ( url ) parsed_url . scheme = protocol return parsed_url . unparse ( )
given an absolute url .