docs: def parse_qs(qs):
      """Helper func to parse query string with py2/py3 compatibility
  
      Ensures that dict keys are native strings.
      """
      result = {}
      qs = bstr(qs, 'latin1')
      pairs = [s2 for s1 in qs.split(b'&') for s2 in s1.split(b';')]
      uq = urlparse.unquote if PY2 else urlparse.unquote_to_bytes
      for name_value in pairs:
          if not name_value:
              continue
          nv = name_value.split(b'=', 1)
          if len(nv) != 2:
              nv.append(b'')
  
          name = nv[0].replace(b'+', b' ')
          name = uq(name)
          if not PY2:  # pragma: no cover py2
              name = ustr(name, 'latin1')
          value = nv[1].replace(b'+', b' ')
          value = uq(value)
          result.setdefault(name, []).append(value)
      return result