Puts the templates into the template cache
549753
function run($templateCache) {
    angular.forEach(examples, function (example) {
      $templateCache.put(example.id + '-template', example.html);
      $templateCache.put(example.id + '-description', example.description);
    });
  }
1119952
function registerTemplates(filepaths, callback) {
    async.map(filepaths, registerTemplate, function (err, templates) {
      if (err) callback(err);
      callback(null, templates);
    });
  }
707900
private void registerTemplates(Iterable<TemplateType> templates, @Nullable Node scopeRoot) {
    if (!Iterables.isEmpty(templates)) {
      // Add any templates from JSDoc into our template scope.
      this.templateScope = typeRegistry.createScopeWithTemplates(templateScope, templates);
      // Register the template types on the scope root node, if there is one.
      if (scopeRoot != null) {
        typeRegistry.registerTemplateTypeNamesInScope(templates, scopeRoot);
      }
    }
  }
419681
public void loadTemplates() throws TemplateException {
        loadStrategyI.loadTemplates();
        this.templateSet = loadStrategyI.getTemplates();
        this.templateOrders = loadStrategyI.getOrders();
    }
8104
public final void setTemplate() {
        template = new HashMap();
        if (isEventExist()) {
            template.putAll(events.get(next));
        }
        template.put("event", eventType);
    }
36302
private static List<Template> sortTemplates(List<Template> templates)
	{
		List<Template> result = new ArrayList<Template>();
		for (Template t : templates)
		{
			int pos = 0;
			while (pos < result.size()
					&& t.getPos().getStart() > result.get(pos).getPos()
							.getStart())
			{
				pos++;
			}
			result.add(pos, t);
		}
		return result;
	}
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;
        }
1014944
def run(self):
        ''''''
        for tpl in self.templates:
            for provider in tpl.providers:
                provider.provide()
882923
function Templates(options) {
  if (!(this instanceof Templates)) {
    return new Templates(options);
  }

  Base.call(this, null, options);
  this.is('templates');
  this.define('isApp', true);
  this.use(utils.option());
  this.use(utils.plugin());
  this.initTemplates();
}
279102
def add_template(self, tpl):
        
        tpl = self.index_template(tpl)
        self.templates[tpl.uuid] = tpl
19448
function(name, eagerCompile, cb) {
                if (name && name.raw) {
                    // this fixes autoescape for templates referenced in symbols
                    name = name.raw;
                }

                if (lib.isFunction(eagerCompile)) {
                    cb = eagerCompile;
                    eagerCompile = false;
                }

                if (typeof name !== 'string') {
                    throw new Error('template names must be a string: ' + name);
                }

                var tmpl = this.cache[name];

                if (tmpl) {
                    if (eagerCompile) {
                        tmpl.compile();
                    }

                    if (cb) {
                        cb(null, tmpl);
                    } else {
                        return tmpl;
                    }
                } else {
                    var syncResult;

                    lib.asyncIter(this.loaders, function(loader, i, next, done) {
                        function handle(src) {
                            if (src) {
                                done(src);
                            } else {
                                next();
                            }
                        }

                        if (loader.async) {
                            loader.getSource(name, function(err, src) {
                                if (err) {
                                    throw err;
                                }
                                handle(src);
                            });
                        } else {
                            handle(loader.getSource(name));
                        }
                    }, function(info) {
                        if (!info) {
                            var err = new Error('template not found: ' + name);
                            if (cb) {
                                cb(err);
                            } else {
                                throw err;
                            }
                        } else {
                            var tmpl = new Template(info.src, this,
                                info.path, eagerCompile);

                            if (!info.noCache) {
                                this.cache[name] = tmpl;
                            }

                            if (cb) {
                                cb(null, tmpl);
                            } else {
                                syncResult = tmpl;
                            }
                        }
                    }.bind(this));

                    return syncResult;
                }
            }
1128908
def update_template(template,**kwargs):
    
    tmpl = db.DBSession.query(Template).filter(Template.id==template.id).one()
    tmpl.name = template.name
    if template.description:
        tmpl.description = template.description

    #Lazy load the rest of the template
    for tt in tmpl.templatetypes:
        for ta in tt.typeattrs:
            ta.attr

    if template.layout:
        tmpl.layout = get_layout_as_string(template.layout)

    type_dict = dict([(t.id, t) for t in tmpl.templatetypes])
    existing_templatetypes = []

    if template.types is not None or template.templatetypes is not None:
        types = template.types if template.types is not None else template.templatetypes
        for templatetype in types:
            if templatetype.id is not None:
                type_i = type_dict[templatetype.id]
                _update_templatetype(templatetype, type_i)
                existing_templatetypes.append(type_i.id)
            else:
                #Give it a template ID if it doesn't have one
                templatetype.template_id = template.id
                new_templatetype_i = _update_templatetype(templatetype)
                existing_templatetypes.append(new_templatetype_i.id)

    for tt in tmpl.templatetypes:
        if tt.id not in existing_templatetypes:
            delete_templatetype(tt.id)

    db.DBSession.flush()

    return tmpl
863080
def render_template(template_in, file_out, context):
    
    renderer = pystache.Renderer()
    result = renderer.render_path(template_in, context)
    with open(file_out, 'w') as handle:
        LOGGER.info('Rendering: {} to {}'.format(template_in, file_out))
        handle.write(result)
    shutil.copymode(template_in, file_out)
607984
def _compose_cheetah_template_map(cache):
    

    from .cheetah import get_templates

    # pylint: disable=W0406
    # needed for introspection
    import javatools

    for template_type in get_templates():
        if "_" not in template_type.__name__:
            # we use the _ to denote package and class names. So any
            # template without a _ in the name isn't meant to be
            # matched to a change type.
            continue

        # get the package and change class names based off of the
        # template class name
        tn = template_type.__name__
        pn, cn = tn.split("_", 1)

        # get the package from javatools
        pk = getattr(javatools, pn, None)
        if pk is None:
            __import__("javatools." + pn)
            pk = getattr(javatools, pn, None)

        # get the class from the package
        cc = getattr(pk, cn, None)
        if cc is None:
            raise Exception("no change class for template %s" % tn)

        # associate a Change class with a Template class
        cache[cc] = template_type

    return cache
1099921
function loadTemplateAndPartials(templateFile, partialsDirectory, partialsExtension, options, cache, callback) {
	handleFile(null, templateFile, options, cache, function(err, partialData) {
		if (err) {
			return callback(err);
		}

		return loadAllPartials(partialData.partials, partialsDirectory, partialsExtension, options, cache, null, function(err, partials) {
			if (err) {
				return callback(err);
			}

			return callback(null, partialData.data, partials);
		});
	});
}
826701
private void addCommaSeparatedChildren(Template template){
		LazyNode next=child;
		boolean first=true;
		while(next!=null){
			if(first){
				first=false;
			}else{
				template.addConstant(",");
			}
			next.addSegments(template);
			next=next.next;
		}
	}
804676
function setCachedTemplateTree( $keyData, $uri, $res, $templatePath, &$extraParameters, &$root )
    {
        $key = $this->cacheKey( $keyData, $res, $templatePath, $extraParameters );
        eZTemplateTreeCache::setCachedTree( $key, $uri, $res, $templatePath, $extraParameters, $root );
        eZTemplateTreeCache::storeCache( $key, $templatePath );
    }