def _GenClientLibFromContents(discovery_doc, language, output_path,
                              client_name):

  body = urllib.urlencode({'lang': language, 'content': discovery_doc})
  request = urllib2.Request(CLIENT_LIBRARY_BASE, body)
  try:
    with contextlib.closing(urllib2.urlopen(request)) as response:
      content = response.read()
      return _WriteFile(output_path, client_name, content)
  except urllib2.HTTPError, error:
    raise ServerRequestException(error)
Write a client library from a discovery doc, using a cloud service to file.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/endpointscfg.py/_GenClientLibFromContents