def urldefragauth(url):
 (scheme, netloc, path, params, query, fragment) = urlparse(url)
 if (not netloc):
  (netloc, path) = (path, netloc)
 netloc = netloc.rsplit('@', 1)[(-1)]
 return urlunparse((scheme, netloc, path, params, query, ''))

def urldefragauth ( url ) : ( scheme , netloc , path , params , query , fragment ) = urlparse ( url ) if ( not netloc ) : ( netloc , path ) = ( path , netloc ) netloc = netloc . rsplit ( '@' , 1 ) [ ( - 1 ) ] return urlunparse ( ( scheme , netloc , path , params , query , '' ) )
given a url remove the fragment and the authentication part .