'Retrieve Credential from datastore.
Returns:
oauth2client.Credentials'

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, credential.to_json())
    return credential
