def _update_query_params(uri, params):
 parts = urllib.parse.urlparse(uri)
 query_params = dict(urllib.parse.parse_qsl(parts.query))
 query_params.update(params)
 new_parts = parts._replace(query=urllib.parse.urlencode(query_params))
 return urllib.parse.urlunparse(new_parts)

def _update_query_params ( uri , params ) : parts = urllib . parse . urlparse ( uri ) query_params = dict ( urllib . parse . parse_qsl ( parts . query ) ) query_params . update ( params ) new_parts = parts . _replace ( query = urllib . parse . urlencode ( query_params ) ) return urllib . parse . urlunparse ( new_parts )
updates a uri with new query parameters .