code: def GetUserinfo(credentials, http=None):  # pylint: disable=invalid-name
      
      http = http or httplib2.Http()
      url = _GetUserinfoUrl(credentials)
      # We ignore communication woes here (i.e. SSL errors, socket
      # timeout), as handling these should be done in a common location.
      response, content = http.request(url)
      if response.status == http_client.BAD_REQUEST:
          credentials.refresh(http)
          url = _GetUserinfoUrl(credentials)
          response, content = http.request(url)
      return json.loads(content or '{}')
docs: Get the userinfo associated with the given credentials.
  
      This is dependent on the token having either the userinfo.email or
      userinfo.profile scope for the given token.
  
      Args:
        credentials: (oauth2client.client.Credentials) incoming credentials
        http: (httplib2.Http, optional) http instance to use
  
      Returns:
        The email address for this token, or None if the required scopes
        aren't available.