code: def normalize_query(query):
      
      if query == '' or len(query) <= 2:
          return ''
      nquery = unquote(query, exceptions=QUOTE_EXCEPTIONS['query'])
      params = nquery.split('&')
      nparams = []
      for param in params:
          if '=' in param:
              k, v = param.split('=', 1)
              if k and v:
                  nparams.append("%s=%s" % (k, v))
      nparams.sort()
      return '&'.join(nparams)
docs: Normalize query: sort params by name, remove params without value.
  
      >>> normalize_query('z=3&y=&x=1')
      'x=1&z=3'