def _ParseResponse(response):

  response.reset()
  parser = feedparser.FeedParser()

  parser._set_headersonly()


  while True:
    line = response.readline()
    if not feedparser.headerRE.match(line):
      if not feedparser.NLCRE.match(line):
        parser.feed(line)
      break
    parser.feed(line)
  parsed_response = parser.close()

  if 'Status' in parsed_response:
    status = int(parsed_response['Status'].split(' ', 1)[0])
    del parsed_response['Status']
  else:
    status = 200
  return {'body': parsed_response.get_payload() + response.read(),
          'headers': parsed_response.items(),
          'response_code': status}
Parses an HTTP response into a dict.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/runtime/cgi.py/_ParseResponse