Return whether to use the datastore for this key.

    Args:
      key: Key instance.
      options: ContextOptions instance, or None.

    Returns:
      True if the datastore should be used, False otherwise.
16323
def _use_datastore(self, key, options=None):
    
    flag = ContextOptions.use_datastore(options)
    if flag is None:
      flag = self._datastore_policy(key)
    if flag is None:
      flag = ContextOptions.use_datastore(self._conn.config)
    if flag is None:
      flag = True
    return flag
82566
def get(self, key):
        

        if not self.is_loaded:
            self.retrieve()

            self.is_loaded = True

        if self.has(key=key):
            return self.data[key]
        else:
            return None
1112258
def get(self, key):
    '''
    '''
    value = self.cache_datastore.get(key)
    return value if value is not None else self.child_datastore.get(key)
587140
def get(self, key, default=None):
        
        try:
            return self[key]
        except KeyError:
            return default or self._default
11638
def key_exists(self, key):
        
        assert isinstance(key, str)
        self._close()
        try:
            return self._unsafe_key_exists(key)
        finally:
            self._open()
106595
def item(self, key):
    
    return _item.Item(self._name, key, context=self._context)
1089579
def put(self, key, value):
    ''''''
    return self.child_datastore.put(self._transform(key), value)
122470
def is_filter_at_key(self, key):
        

        if key in self:
            attribute_status = getattr(self, key)
            if isinstance(attribute_status, self.__class__):
                return True

        return False
211283
def get(self, key, default=CACHE_MISS):
        
        if not self.options.enabled:
            return CACHE_DISABLED
        ret = default
        if self.has(key):
            ret = self._dict[key].value
        logger.debug('get({}, default={}) == {}'.format(repr(key), repr(default), repr(ret)))
        return ret
449412
def get(self, key, default=None):
        
        result = self._loads(self._client.get(self.get_key(key)))
        if result is not None:
            return result
        else:
            return default or self._default
328167
def has_datastore(self):
        # type: () -> bool
        
        success, result = self._read_from_hdx('datastore', self.data['id'], 'resource_id',
                                              self.actions()['datastore_search'])
        if not success:
            logger.debug(result)
        else:
            if result:
                return True
        return False
193960
def _handle_result_by_key(self, key):
        
        invalid_options = ('key', 'keys', 'startkey', 'endkey')
        if any(x in invalid_options for x in self.options):
            raise ResultException(102, invalid_options, self.options)
        return self._ref(key=key, **self.options)
26384
def get(self, key):
        '''
        
        '''
        if key in self._data_fields:
            return self._data_fields[key]
        if key in self._sub_reports:
            return self._sub_reports[key]
        return None
792112
def setdefault(self, key, value):
        
        try:
            super(FlaskConfigStorage, self).setdefault(key, value)
        except RuntimeError:
            self._defaults.__setitem__(key, value)
526071
def exists(self, key):
    
    if key in self._keystore and not self._keystore[key].is_expired:
      return True
    elif key in self._keystore and self._keystore[key].is_expired:
      self.delete(key)
      return False

    return False
601136
def get(self, key):
    '''
    '''
    self.logger.info('%s: get %s' % (self, key))
    value = super(LoggingDatastore, self).get(key)
    self.logger.debug('%s: %s' % (self, value))
    return value
617528
def key(self, *args, _prefix=None, **kwargs):
        
        if kwargs:
            raise NotImplementedError(
                'kwarg cache keys not implemented')
        return (_prefix,) + tuple(args)