def locked_get(self):
    if self._cache:
      json = self._cache.get(self._key_name)
      if json:
        return Credentials.new_from_json(json)

    credential = None
    entity = self._model.get_by_key_name(self._key_name)
    if entity is not None:
      credential = getattr(entity, self._property_name)
      if credential and hasattr(credential, 'set_store'):
        credential.set_store(self)
        if self._cache:
          self._cache.set(self._key_name, credentials.to_json())

    return credential
Retrieve Credential from datastore.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/google-api-python-client/oauth2client/appengine.py/StorageByKeyName.locked_get