def url_add_parameters(url, params):
 if params:
  fragments = list(urlparse(url))
  fragments[4] = urlencode((parse_qsl(fragments[4]) + params.items()))
  url = urlunparse(fragments)
 return url

def url_add_parameters ( url , params ) : if params : fragments = list ( urlparse ( url ) ) fragments [ 4 ] = urlencode ( ( parse_qsl ( fragments [ 4 ] ) + params . items ( ) ) ) url = urlunparse ( fragments ) return url
adds parameters to url .