The low-level function to get the cache key for a model.
187033
def get_urlfield_cache_key(model, pk, language_code=None):
    
    return 'anyurlfield.{0}.{1}.{2}.{3}'.format(model._meta.app_label, model.__name__, pk, language_code or get_language())
13725
def _get_cache_plus_key(self):
        """"""
        key = getattr(self, '_cache_key', self.key_from_query())
        return self._cache.cache, key
891560
def generate_key(self):
        
        sql = self.sql()
        key, created = self.get_or_create_model_key()
        if created:
            db_table = self.model._meta.db_table
            logger.debug('created new key {0} for model {1}'.format(key, db_table))
            model_cache_info = ModelCacheInfo(db_table, key)
            model_cache_backend.share_model_cache_info(model_cache_info)
        query_key = u'{model_key}{qs}{db}'.format(model_key=key,
                                                  qs=sql,
                                                  db=self.db)
        key = hashlib.md5(query_key.encode('utf-8')).hexdigest()
        return key
547357
private String getKey(Object key) {
        if (key == null) {
            throw new IllegalArgumentException("Cache key not be null");
        }

        return ObjectUtils.toString(key);
    }
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
993498
def get_cache_key(self, offset=0, limit=0, order=None, post_slug=''):
        
        return hashlib.sha1(
            '.'.join([
                str(self._get_data_source_url()),
                str(offset),
                str(limit),
                str(order),
                str(post_slug),
                ])
        ).hexdigest()
660453
def _get(self, key):
        """"""
        self._populate_cache()
        if key not in self._cache:
            raise AttributeError("DataField has no member {}".format(key))

        return self._cache[key]
941987
def _get_destcache(self, graph, orig, branch, turn, tick, *, forward):
        """"""
        destcache, destcache_lru, get_keycachelike, successors, adds_dels_sucpred = self._get_destcache_stuff
        lru_append(destcache, destcache_lru, ((graph, orig, branch), turn, tick), KEYCACHE_MAXSIZE)
        return get_keycachelike(
            destcache, successors, adds_dels_sucpred, (graph, orig),
            branch, turn, tick, forward=forward
        )
150211
def get_cache_key(self, name, filename=None):
        """"""
        hash = sha1(name.encode('utf-8'))
        if filename is not None:
            filename = '|' + filename
            if isinstance(filename, text_type):
                filename = filename.encode('utf-8')
            hash.update(filename)
        return hash.hexdigest()
452237
def cache_key(*args, **kwargs):
    
    key = ""
    for arg in args:
        if callable(arg):
            key += ":%s" % repr(arg)
        else:
            key += ":%s" % str(arg)

    return key
1046031
def cache_key(self):
        
        return '%s:%s' % (super(EntryPublishedVectorBuilder, self).cache_key,
                          Site.objects.get_current().pk)
561180
def key_for_property(cls, kind, property):
    
    return model.Key(Kind.KIND_NAME, kind, Property.KIND_NAME, property)
1119287
function (key) {
            var modelVal = this.getModelVal();
            modelVal = this.multiple ? modelVal : [modelVal];
            return (_.indexOf(_.map(modelVal, toStr), toStr(key)) > -1);
        }
916324
def get_cache_key(datatable_class, view=None, user=None, **kwargs):
    

    datatable_name = datatable_class.__name__
    if datatable_name.endswith('_Synthesized'):
        datatable_name = datatable_name[:-12]
    datatable_id = '%s.%s' % (datatable_class.__module__, datatable_name)
    if CACHE_KEY_HASH:
        datatable_id = _hash_key_component(datatable_id)

    cache_key = 'datatable_%s' % (datatable_id,)

    if view:
        if not inspect.isclass(view):
            # Reduce view to its class
            view = view.__class__

        view_id = '%s.%s' % (view.__module__, view.__name__)
        if CACHE_KEY_HASH:
            view_id = _hash_key_component(view_id)
        cache_key += '__view_%s' % (view_id,)

    if user and user.is_authenticated():
        cache_key += '__user_%s' % (user.pk,)

    # All other kwargs are used directly to create a hashed suffix
    # Order the kwargs by key name, then convert them to their repr() values.
    items = sorted(kwargs.items(), key=lambda item: item[0])
    values = []
    for k, v in items:
        values.append('%r:%r' % (k, v))

    if values:
        kwargs_id = '__'.join(values)
        kwargs_id = _hash_key_component(kwargs_id)
        cache_key += '__kwargs_%s' % (kwargs_id,)

    log.debug("Cache key derived for %r: %r (from kwargs %r)", datatable_class, cache_key, values)

    return cache_key
366647
def get_cached_value(self, *args, **kwargs):
        
        key = self.get_cache_key(*args, **kwargs)
        logger.debug(key)
        return self.cache.get(key, default=Ellipsis)
1047972
def get_primary_key(model):
    """"""
    model = get_model(model)
    return (field.name for field in model._meta.fields if field.primary_key).next()
571175
def getCachedDataKey(engineVersionHash, key):
		
		cacheFile = CachedDataManager._cacheFileForHash(engineVersionHash)
		return JsonDataManager(cacheFile).getKey(key)