code: def add_params_to_qs(query, params):
      
      if isinstance(params, dict):
          params = params.items()
      queryparams = urlparse.parse_qsl(query, keep_blank_values=True)
      queryparams.extend(params)
      return urlencode(queryparams)
docs: Extend a query with a list of two-tuples.