def _cache_support(self, name, timeout, vary_on, caller):
    key_seeds = [name, local.request.lang]
    if vary_on is not None:
      if isinstance(vary_on, tuple):
        for v in vary_on:
          key_seeds.append(str(v))
      else:
        key_seeds.append(str(vary_on))
    key = sha1('|'.join(key_seeds).encode('utf-8')).hexdigest()
    # try to load the block from the cache
    # if there is no fragment in the cache, render it and store
    # it in the cache.
    rv = memcache.get(key, namespace=self.environment.fragment_cache_ns)
    if rv is not None:
      logging.debug('Fragment cache hit: key "%s".' % key)
      return rv
    rv = caller()
    memcache.set(key, rv, timeout,
                 namespace=self.environment.fragment_cache_ns)
    logging.debug('Fragment cache set: key "%s".' % key)
    return rv
download a dataset from biomart and output as a
dataset/ETHPy150Open IanLewis/kay/kay/jinja2ext.py/FragmentCacheExtension._cache_support--crossover with--dataset/ETHPy150Open CGATOxford/cgat/CGAT/Biomart.py/biomart_iterator