code: def url_to_query(url):
          
          q = {}
  
          # pylint: disable=unpacking-non-sequence
          (ignore, ignore, path,
           ignore, query, ignore) = urlparse(url)
  
          base = os.path.basename(path)
          if base not in ('buglist.cgi', 'query.cgi'):
              return {}
  
          for (k, v) in parse_qsl(query):
              if k not in q:
                  q[k] = v
              elif isinstance(q[k], list):
                  q[k].append(v)
              else:
                  oldv = q[k]
                  q[k] = [oldv, v]
  
          # Handle saved searches
          if base == "buglist.cgi" and "namedcmd" in q and "sharer_id" in q:
              q = {
                  "sharer_id": q["sharer_id"],
                  "savedsearch": q["namedcmd"],
              }
  
          return q
docs: Given a big huge bugzilla query URL, returns a query dict that can
          be passed along to the Bugzilla.query() method.