Returns the key used for storing results in cache.
771723
def cache_key(self, repo: str, branch: str, task: Task, git_repo: Repo) -> str:
        
        return "{repo}_{branch}_{hash}_{task}".format(repo=self.repo_id(repo),
                                                      branch=branch,
                                                      hash=self.current_git_hash(repo, branch, git_repo),
                                                      task=task.hash)
1356397
def get(self, key, bucket):
        

        try:
            return self._cache[bucket][key]
        except (KeyError, TypeError):
            return None
63842
def _session_key(self):
        """"""

        if not hasattr(self, "_cached_session_key"):
            session_id_bytes = self.get_secure_cookie("session_id")
            session_id = None

            if session_id_bytes:
                try:
                    session_id = session_id_bytes.decode('utf-8')
                except:
                    pass

            if not session_id:
                session_id = oz.redis_sessions.random_hex(20)

            session_time = oz.settings["session_time"]
            kwargs = dict(
                name="session_id",
                value=session_id.encode('utf-8'),
                domain=oz.settings.get("cookie_domain"),
                httponly=True,
            )
            if session_time:
                kwargs["expires_days"] = round(session_time/60/60/24)

            self.set_secure_cookie(**kwargs)

            password_salt = oz.settings["session_salt"]
            self._cached_session_key = "session:%s:v4" % oz.redis_sessions.password_hash(session_id, password_salt=password_salt)

        return self._cached_session_key
958398
def cache_key_name(cls, *args):
        """"""
        if cls.KEY_FIELDS != ():
            if len(args) != len(cls.KEY_FIELDS):
                raise TypeError(
                    "cache_key_name() takes exactly {} arguments ({} given)".format(len(cls.KEY_FIELDS), len(args))
                )
            # pylint: disable=unicode-builtin
            return 'configuration/{}/current/{}'.format(cls.__name__, ','.join(six.text_type(arg) for arg in args))
        else:
            return 'configuration/{}/current'.format(cls.__name__)
1161763
public String getCacheKey() {
		StringBuilder builder = new StringBuilder(100);
		builder.append("qdata{");
		addCommonCacheKeyParts(builder);
		if(fetchOptions.getOffset() != null) {
			builder.append(",off=").append(fetchOptions.getOffset());
		}
		if(fetchOptions.getLimit() != null) {
			builder.append(",lim=").append(fetchOptions.getLimit());
		}
		if (fetchOptions.getStartCursor() != null) {
			builder.append(",start=").append(fetchOptions.getStartCursor().toWebSafeString());
		}
		if (fetchOptions.getEndCursor() != null) {
			builder.append(",end=").append(fetchOptions.getEndCursor().toWebSafeString());
		}
		builder.append("}");
		return builder.toString();
	}
1070468
def get(key)
      return nil if !@items.key?(key)
      return @results_cache[key] if @results_cache.key?(key)
      @results_cache[key] = @items[key].call
    end
750302
function getKeys (memcached, cb) {
  var keyArray = []
  var keyLength = 0

  memcached.items().then(function (items) {
    items.forEach(function (item) {
      keyLength += item.data.number

      memcached.cachedump(item.slab_id, item.data.number).then(function (dataSet) {
        dataSet.forEach(function (data) {
          if (data.key) {
            memcached.get(data.key).then(function (val) {
              if (val) {
                keyArray.push(data.key)
              }

              keyLength -= 1

              if (keyLength === 0) {
                cb(null, keyArray)
              }
            })
          }
        })
      })
    })
  }).catch(function (err) {
    cb(err)
  })
}
625003
def _get_code(self, key):
        

        data = self.grid.code_array(key)
        self.grid.code_array.result_cache.clear()

        return data
16572
public V get(K key)
  {
    Object okey = key;
    if (okey == null)
      okey = NULL;

    int hash = (okey.hashCode() & 0x7fffffff) % _prime;

    CacheItem<K,V> item;

    for (item = _entries[hash];
         item != null;
         item = item._nextHash) {
      Object itemKey = item._key;

      if (itemKey == okey || itemKey.equals(okey)) {
        updateLru(item);

        if (_isEnableStatistics)
          _hitCount++;

        return item._value;
      }
    }

    if (_isEnableStatistics) {
      _missCount++;
    }

    return null;
  }
616434
def _cache_key(cmd_id):
        """"""
        return '{}__{}__{}__{}'.format(
            cmd_id.generationTime, cmd_id.origin, cmd_id.sequenceNumber,
            cmd_id.commandName)
297767
def get_memory_cache(self, key=None):
        """"""
        key = self.model.hash if key is None else key
        self._results = self.memory_cache.get(key)
        return self._results
65587
def get(self, key):
        
        if key in self.cache:
            self.hits += 1
            return self.cache[key]
        self.misses += 1
        return None
1102740
def keys(self):
        """"""

        keys = OrderedDict()

        def order_key(_):
            (k, v) = _
            cache_key = getattr(type(self), k)
            return cache_key.order

        items = [(k, getattr(type(self), k)) for k
            in dir(type(self))
        ]
        items = [(k, v) for (k, v)
            in items
            if isinstance(v, Key)
        ]

        for k, v in sorted(items, key=order_key):
            keys[k] = getattr(self, k)
        return keys
902252
def cache_key(self):
        """"""
        try:
            return self.path
        except TypeError:
            raise TypeError("self.path is invalild: '{}', '{}'".format(str(self.path), type(self.path)))
230576
def cache_key(model, pk):
    ""
    app = model._meta.app_label
    name = model._meta.module_name
    return 'api:{0}:{1}:{2}'.format(app, name, pk)
640790
def get(key)
      return nil if !@actions.has_key?(key)
      return @results_cache[key] if @results_cache.has_key?(key)
      @results_cache[key] = @actions[key].call
    end
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()