Retrieve the cached version of the template
773990
def _get_template(self, template_name):
        
        if template_name not in self.chached_templates:
            self.chached_templates[template_name] = self.env.get_template(template_name)
        return self.chached_templates[template_name]
634090
def get_template(self):
        
        if self.template:
            return self.template

        template = None
        for p in self.get_ancestors(ascending=True):
            if p.template:
                template = p.template
                break

        if not template:
            template = settings.PAGE_DEFAULT_TEMPLATE

        return template
420531
def get_version(self, cached=True):
        """"""
        if hasattr(self.__class__, '_version') and cached:
            version = self.__class__._version
        else:
            repo = self.get_repo()
            if repo is not None:
                head = repo.head
                version = head.commit.hexsha
                if repo.is_dirty():
                    version += "*"
            else:
                version = None
        self.__class__._version = version
        return version
621571
function(template, templateUrl) {
          var deferred = $q.defer();

          if (template) {
            deferred.resolve(template);

          } else if (templateUrl) {
            //  Check to see if the template has already been loaded.
            var cachedTemplate = $templateCache.get(templateUrl);

            if (cachedTemplate) {
              deferred.resolve(cachedTemplate);

            } else {
              //  If not, let's grab the template for the first time.
              $http.get(templateUrl).then(function(result) {

                //  Save template into the cache and return the template.
                $templateCache.put(templateUrl, result.data);

                deferred.resolve(result.data);

              }, function(error) {
                deferred.reject(error);
              });
            }

          } else {
            deferred.reject('No template or templateUrl has been specified.');
          }

          return deferred.promise;
        }
1042873
def get(self, template_name):
        """"""
        template = db.Template.find_one(template_name=template_name)

        if not template:
            return self.make_response('No such template found', HTTP.NOT_FOUND)

        return self.make_response({'template': template})
1345197
def get_cached_placeholder_output(parent_object, placeholder_name):
    
    if not PlaceholderRenderingPipe.may_cache_placeholders():
        return None

    language_code = get_parent_language_code(parent_object)
    cache_key = get_placeholder_cache_key_for_parent(parent_object, placeholder_name, language_code)
    return cache.get(cache_key)
90772
def _render(self, context):
        "  "
        if self.template_name:
            t = loader.get_template(self.template_name)
        else:
            t_list = self._get_template_list()
            t = loader.select_template(t_list)

        context.update(self.get_context())
        resp = t.render(context)
        context.pop()
        return resp
303756
def get_template(
            self,
            url,
            dest,
            template='jinja',
            makedirs=False,
            saltenv='base',
            cachedir=None,
            **kwargs):
        '''
        
        '''
        if 'env' in kwargs:
            # "env" is not supported; Use "saltenv".
            kwargs.pop('env')

        kwargs['saltenv'] = saltenv
        url_data = urlparse(url)
        sfn = self.cache_file(url, saltenv, cachedir=cachedir)
        if not sfn or not os.path.exists(sfn):
            return ''
        if template in salt.utils.templates.TEMPLATE_REGISTRY:
            data = salt.utils.templates.TEMPLATE_REGISTRY[template](
                sfn,
                **kwargs
            )
        else:
            log.error(
                'Attempted to render template with unavailable engine %s',
                template
            )
            return ''
        if not data['result']:
            # Failed to render the template
            log.error('Failed to render template with error: %s', data['data'])
            return ''
        if not dest:
            # No destination passed, set the dest as an extrn_files cache
            dest = self._extrn_path(url, saltenv, cachedir=cachedir)
            # If Salt generated the dest name, create any required dirs
            makedirs = True

        destdir = os.path.dirname(dest)
        if not os.path.isdir(destdir):
            if makedirs:
                os.makedirs(destdir)
            else:
                salt.utils.files.safe_rm(data['data'])
                return ''
        shutil.move(data['data'], dest)
        return dest
335812
def find_inheritable_template_folder_cached(view_context, name, partial, formats, param = nil)
      prefix = inheritable_cache_get(formats, name, partial, param)
      return prefix if prefix
      
      prefix = yield
      
      if prefix
        template = view_context.find_template_without_lookup(name, prefix, partial)
        inheritable_cache_set(template.formats, name, partial, param, prefix)
      end
      prefix
    end
182429
def get_version(package_name, ignore_cache=False):
    
    if ignore_cache:
        with microcache.temporarily_disabled():
            found = helpers.regex_in_package_file(
                VERSION_SET_REGEX, '_version.py', package_name, return_match=True
            )
    else:
        found = helpers.regex_in_package_file(
            VERSION_SET_REGEX, '_version.py', package_name, return_match=True
        )
    if found is None:
        raise ProjectError('found {}, but __version__ is not defined')
    current_version = found['version']
    return current_version
1113408
public T getTemplateFromCache(String filename) {

        LRUCache.CacheEntry<String, T> cachedTemplate = cache.get(filename);

        // this is to avoid null pointer exception in case of the layout composite template
        if (cachedTemplate == null) {
            return null;
        }

        return cachedTemplate.compiled;
    }
585286
def find_template(self, name, dirs=None):
        
        key = self.cache_key(name, dirs)
        try:
            result = self.find_template_cache[key]
        except KeyError:
            result = None
            for loader in self.loaders:
                try:
                    template, display_name = loader(name, dirs)
                except TemplateDoesNotExist:
                    pass
                else:
                    origin = make_origin(self.engine, display_name, loader, name, dirs)
                    result = template, origin
                    break
        self.find_template_cache[key] = result
        if result:
            return result
        else:
            self.template_cache[key] = TemplateDoesNotExist
            raise TemplateDoesNotExist(name)
1132030
def get_template(template_id, opts = {})
      data, _status_code, _headers = get_template_with_http_info(template_id, opts)
      data
    end
367238
def cached(func, instance, args, kwargs):
    """"""
    cache = getattr(instance, "__cache", None)
    if cache is None:
        instance.__cache = cache = {}
    try:
        return cache[func]
    except KeyError:
        cache[func] = result = func(*args, **kwargs)
        return result
94628
def get_template(self, name):
        """"""
        filename = path.join(self.search_path, *[p for p in name.split('/')
                                                 if p and p[0] != '.'])
        if not path.exists(filename):
            raise TemplateNotFound(name)
        return Template.from_file(filename, self.encoding)
1004005
def get(self, version, use_cache=True):
        
        self.log.info('Retrieving %s version %s', self.meta_name, version.version)

        if version.filepath:
            if use_cache:
                return version.filepath
            else:
                self.log.info('Ignoring cached %s version: %s', self.meta_name, version.version)
        elif not use_cache:
            self.log.info("We can't ignore the cache of a version that hasn't been downloaded yet")

        version.download()
        return version.filepath
1122723
def get_template(template):
    
    from cloud_inquisitor.database import db

    tmpl = db.Template.find_one(template_name=template)
    if not tmpl:
        raise InquisitorError('No such template found: {}'.format(template))

    tmplenv = Environment(loader=BaseLoader, autoescape=True)
    tmplenv.filters['json_loads'] = json.loads
    tmplenv.filters['slack_quote_join'] = lambda data: ', '.join('`{}`'.format(x) for x in data)

    return tmplenv.from_string(tmpl.template)