def urlunsplit(data):
 (scheme, netloc, url, query, fragment) = data
 if (netloc or (scheme and (scheme in uses_netloc) and (url[:2] != '//'))):
  if (url and (url[:1] != '/')):
   url = ('/' + url)
  url = (('//' + (netloc or '')) + url)
 if scheme:
  url = ((scheme + ':') + url)
 if query:
  url = ((url + '?') + query)
 if fragment:
  url = ((url + '#') + fragment)
 return url

def urlunsplit ( data ) : ( scheme , netloc , url , query , fragment ) = data if ( netloc or ( scheme and ( scheme in uses_netloc ) and ( url [ : 2 ] != '//' ) ) ) : if ( url and ( url [ : 1 ] != '/' ) ) : url = ( '/' + url ) url = ( ( '//' + ( netloc or '' ) ) + url ) if scheme : url = ( ( scheme + ':' ) + url ) if query : url = ( ( url + '?' ) + query ) if fragment : url = ( ( url + '#' ) + fragment ) return url
combine the elements of a tuple as returned by urlsplit() into a complete url as a string .