Generator returning all the mors in the cache for the given instance key.
355770
def mors(self, key):
        
        with self._mor_lock:
            for k, v in iteritems(self._mor.get(key, {})):
                yield k, v
712308
def get(self, *args, **kwargs):
        """"""
        assert not args
        assert list(kwargs.keys()) == ['pk']
        pk = kwargs['pk']
        model_name = self.model.__name__
        object_spec = (model_name, pk, None)
        instances = self.cache.get_instances((object_spec,))
        try:
            model_data = instances[(model_name, pk)][0]
        except KeyError:
            raise self.model.DoesNotExist(
                "No match for %r with args %r, kwargs %r" %
                (self.model, args, kwargs))
        else:
            return CachedModel(self.model, model_data)
89848
public Object getCache(Object key, String className) {
		return modelCacheManager.getCache(key, className);

	}
695078
def iter_instances(self):
        
        for wrkey in set(self.keys()):
            obj = self.get(wrkey)
            if obj is None:
                continue
            yield wrkey, obj
750257
public static <K, V> Maybe<Map<K, V>> getAll(String key, Class<K> kClazz, Class<V> vClazz) {
        return getAll(CacheService.CACHE_CONFIG_BEAN, key, kClazz, vClazz);
    }
23096
def get_all
      instances = features.map { |key| Flipper::Feature.new(key, self) }
      get_multi(instances)
    end
888703
def dict_of(**kwargs):
    

    class DictOfKeyGenerators(ArbitraryInterface):
        """
        A closure class around the keys and generators specified above, which
        generates a dict of the keys and generators.
        """

        @classmethod
        def arbitrary(cls):
            """
            Generate a dict of the enclosed keys and generators.
            """
            return {
                key: arbitrary(generator)
                for key, generator in kwargs.iteritems()
            }

    DictOfKeyGenerators.__name__ = ''.join([
        'dict_of(', ', '.join([
            key + '=' + generator.__name__
            for key, generator in kwargs.iteritems()
        ]), ')'
    ])
    return DictOfKeyGenerators
279780
function instance_getters () {
        var _parseArguments = parseArguments$1(arguments),
            getters = _parseArguments.getters,
            options = _parseArguments.options;

        return Object.keys(getters).reduce(function (instanceGetters, name) {
            instanceGetters[name] = function (state, otherGetters) {
                return function (instanceKey) {
                    var instance = state[options.stateKey || 'instances'].find(function (obj) {
                        return obj[options.instanceKey || 'id'] === instanceKey;
                    });

                    if (instance) {
                        return getters[name](instance, otherGetters, state, instanceKey);
                    }
                };
            };

            return instanceGetters;
        }, {});
    }
935406
def fetch(key, *args, &block)   #:yield: +key+
      a = @header.fetch(key.downcase, *args, &block)
      a.kind_of?(Array) ? a.join(', ') : a
    end
501503
def get_object_cache_keys(instance):
    
    if not instance.pk or instance._state.adding:
        return []

    keys = []
    for language in _get_available_languages(instance):
        keys.append(get_urlfield_cache_key(instance.__class__, instance.pk, language))

    return keys
329318
@Override
	public List<ICacheKeyGenerator> getCacheKeyGenerators(IAggregator aggregator) {
		// Return a provisional cache key generator
		ArrayList<ICacheKeyGenerator> keyGens = new ArrayList<ICacheKeyGenerator>();
		keyGens.addAll(super.getCacheKeyGenerators(aggregator));
		keyGens.add(new CacheKeyGenerator(null, true));
		return keyGens;
	}
1272217
def hash_key(*args, **kwargs):
    """"""

    if kwargs:
        return cachetools.keys._HashedTuple(args + _kwargs_mark + tuple(itertools.chain(sorted(kwargs.items()))))
    else:
        return cachetools.keys._HashedTuple(args)
33503
def generate_cache_key(cached, **kwargs):
    

    if isinstance(cached, QuerySet):
        key = str(cached.query)

    elif isinstance(cached, (Model, ModelBase)):
        key = '%s.%s:%s' % (cached._meta.app_label,
                            cached._meta.module_name,
                            ','.join('%s=%s' % item for item in kwargs.iteritems()))

    else:
        raise AttributeError("Objects must be queryset or model.")

    if not key:
        raise Exception('Cache key cannot be empty.')

    key = clean_cache_key(key)
    return key
511030
function (key, instance) {
            if (arguments.length == 1) {
                instance = key;
                key = null;
            }

            if (key) {
                this.$singletonInstanceCache[key] = instance;
            } else {
                this.$singletonInstanceCache.push(instance);
            }


        }
350247
def gets(self, key):
        ""
        result_list = []
        if key in self.keys():
            result_list.append(self[key])
        for v in self.values():
            if isinstance(v, self.__class__):
                sub_res_list = v.gets(key)
                for res in sub_res_list:
                    result_list.append(res)
            elif isinstance(v, dict):
                if key in v.keys():
                    result_list.append(v[key])
        return result_list
887093
def get_keys(self):
        '''
        
        '''
        # Make sure all key parent directories are accessible
        user = self.opts.get('user', 'root')
        salt.utils.verify.check_path_traversal(self.opts['pki_dir'], user)

        if not os.path.exists(self.rsa_path):
            log.info('Generating keys: %s', self.opts['pki_dir'])
            gen_keys(self.opts['pki_dir'],
                     'minion',
                     self.opts['keysize'],
                     self.opts.get('user'))
        key = get_rsa_key(self.rsa_path, None)
        log.debug('Loaded minion key: %s', self.rsa_path)
        return key
581739
def get_instance(key, expire=None):
    """"""
    global _instances
    try:
        instance = _instances[key]
    except KeyError:
        instance = RedisSet(
            key,
            _redis,
            expire=expire
        )
        _instances[key] = instance

    return instance