Returns a function that will return the transform cache key based on some
passed transform options.
541507
function getTransformCacheKey(opts: {|
  +cacheVersion: string,
  +projectRoot: string,
  +transformerConfig: TransformerConfig,
|}): string {
  const {transformerPath, transformerConfig} = opts.transformerConfig;

  // eslint-disable-next-line lint/flow-no-fixme
  /* $FlowFixMe: dynamic requires prevent static typing :'(  */
  const Transformer = require(transformerPath);
  const transformerInstance = new Transformer(
    opts.projectRoot,
    transformerConfig,
  );

  const transformerKey =
    typeof transformerInstance.getCacheKey !== 'undefined'
      ? transformerInstance.getCacheKey()
      : '';

  const cacheKeyParts = [
    'metro-cache',
    VERSION,
    opts.cacheVersion,
    path.relative(path.join(__dirname, '../../../..'), opts.projectRoot),
    getKeyFromFiles([require.resolve(transformerPath)]),
    transformerKey,
  ];

  return crypto
    .createHash('sha1')
    .update(cacheKeyParts.join('$'))
    .digest('hex');
}
677540
def get_cache_key_args(self):
        
        cache_key_args = dict(
            nodename=self.node.nodename,
            name=self.fragment_name,
            hash=self.hash_args(),
        )
        if self.options.include_pk:
            cache_key_args['pk'] = self.get_pk()

        return cache_key_args
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__)
934321
def get_action_cache_key(name, argument):
    """"""
    tokens = [str(name)]
    if argument:
        tokens.append(str(argument))
    return '::'.join(tokens)
891298
def get_transformation(name: str):
    
    func = mapped.get(name)

    if func is None:
        raise MissingPipelineFunctionError('{} is not registered as a pipeline function'.format(name))

    return func
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
        )
500071
function transformObject (type) {
  const transformed = {}

  for (let key in type) {
    transformed[key] = transformType(type[key])
  }

  return transformed
}
278320
function getKey(key) {
  if(this.conf.transform) {
    if(typeof(this.conf.transform.key) == 'function') {
      return this.conf.transform.key.call(this, key);
    }
  }
  key = delimited(key, this.conf.delimiter);
  key = key.replace(/- /, this.conf.delimiter);
  key = key.replace(/[^a-zA-Z0-9_]/, '');
  if(this.conf.prefix) {
    return this.conf.prefix + this.conf.delimiter + key.toLowerCase()
  }
  return key.toLowerCase();
}
201684
function shouldTransform (req, res) {
  var cacheControl = res.getHeader('Cache-Control')

  // Don't compress for Cache-Control: no-transform
  // https://tools.ietf.org/html/rfc7234#section-5.2.2.4
  return !cacheControl ||
    !cacheControlNoTransformRegExp.test(cacheControl)
}
13725
def _get_cache_plus_key(self):
        """"""
        key = getattr(self, '_cache_key', self.key_from_query())
        return self._cache.cache, key
327910
def get(self, class_name):
        """"""
        for transform in self.cpu_transforms + self.gpu_transforms:
            if transform.__class__.__name__ == class_name:
                return transform
804412
def cache_get(key):
    
    packed = cache.get(_hashed_key(key))
    if packed is None:
        return None
    value, refresh_time, refreshed = packed
    if (time() > refresh_time) and not refreshed:
        cache_set(key, value, settings.CACHE_SET_DELAY_SECONDS, True)
        return None
    return value
758523
def cachedmethod(cache, key=keys.hashkey, lock=None):
    
    def decorator(method):
        if lock is None:
            def wrapper(self, *args, **kwargs):
                c = cache(self)
                if c is None:
                    return method(self, *args, **kwargs)
                k = key(*args, **kwargs)
                try:
                    return c[k]
                except KeyError:
                    pass  # key not found
                v = method(self, *args, **kwargs)
                try:
                    c[k] = v
                except ValueError:
                    pass  # value too large
                return v
        else:
            def wrapper(self, *args, **kwargs):
                c = cache(self)
                if c is None:
                    return method(self, *args, **kwargs)
                k = key(*args, **kwargs)
                try:
                    with lock(self):
                        return c[k]
                except KeyError:
                    pass  # key not found
                v = method(self, *args, **kwargs)
                try:
                    with lock(self):
                        c[k] = v
                except ValueError:
                    pass  # value too large
                return v
        return _update_wrapper(wrapper, method)
    return decorator
927746
function cacheGet(key, options) {
    if (shouldCache(options)) {
      return;
    }

    if (self.options.cache === 'memory') {
      return self.cache[key];
    }

    return self.options.cache.get(key);
  }
110641
def get_cacheable(cache_key, cache_ttl, calculate, recalculate=False):
    
    if not recalculate:
        cached = cache.get(cache_key)
        if cached is not None:
            return json.loads(cached)

    calculated = calculate()
    cache.set(cache_key, json.dumps(calculated), cache_ttl)

    return calculated
881955
def get(self, object_type, cache_key):
        
        if object_type not in self.mapping or self.disabled:
            return None
        cache = self.mapping[object_type]
        if cache_key in cache:
            log.debug("Cache HIT: [%s %s]" % (object_type.capitalize(), cache_key))
            return cache[cache_key]
        else:
            log.debug('Cache MISS: [%s %s]' % (object_type.capitalize(), cache_key))
902252
def cache_key(self):
        """"""
        try:
            return self.path
        except TypeError:
            raise TypeError("self.path is invalild: '{}', '{}'".format(str(self.path), type(self.path)))