def FetchCredentials(auth_params):
  """General utility to make fetch requests to OAuth Service.

  Args:
    auth_params: The OAuth parameters to use for the request.

  Returns:
    A dict with the response status code and content.
  """
  auth_status = {
      'status_code': 400
  }

  auth_payload = urllib.urlencode(auth_params)

  try:
    response = urlfetch.fetch(url=OAUTH_TOKEN_ENDPOINT,
                              payload=auth_payload,
                              method=urlfetch.POST,
                              headers={
                                  'Content-Type':
                                  'application/x-www-form-urlencoded'
                              })

    response_content = json.loads(response.content)

    if response.status_code == 200:
      auth_status['status_code'] = 200

    auth_status['content'] = response_content

  except (ValueError, __HOLE__, AttributeError, urlfetch.Error), e:
    auth_status['content'] = str(e)

  return auth_status
dataset/ETHPy150Open googleanalytics/google-analytics-super-proxy/src/controllers/util/analytics_auth_helper.py/FetchCredentials