@staticmethod
  def _quote_querystring(qs):

    parsed_qs = urlparse.parse_qs(qs, keep_blank_values=True)
    # urlparse.parse returns a dictionary with values as lists while
    # urllib.urlencode does not handle those. Expand to a list of
    # key values.
    expanded_qs = []
    for key, multivalue in parsed_qs.items():
      for value in multivalue:
        expanded_qs.append((key, value))
    return urllib.urlencode(expanded_qs)
Quote a query string to protect against XSS.
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/tools/devappserver2/module.py/Module._quote_querystring