Create a new Template expression

@deprecated Use {@link #template(Class, Template, List)} instead.

@param cl type of expression
@param template template
@param args template parameters
@return template expression
518142
@SuppressWarnings("unchecked")
    @Deprecated
    public static <T> TemplateExpression<T> template(Class<? extends T> cl, Template template, ImmutableList<?> args) {
        if (cl.equals(Boolean.class)) {
            return (TemplateExpression<T>) new PredicateTemplate(template, args);
        } else {
            return new TemplateExpressionImpl<T>(cl, template, args);
        }
    }
482440
function(template) {
    if (template && !template.compiled) {
      // Set compiling flag on fragments, but don't turn it false until the outermost template is done
      var lastCompilingValue = this.compiling;
      this.compiling = true;
      // Set this before compiling so we don't get into infinite loops if there is template recursion
      template.compiled = true;
      template.bindings = compile(this, template);
      this.compiling = lastCompilingValue;
    }
    return template;
  }
513786
public static <T extends Comparable<?>> DateTemplate<T> dateTemplate(Class<? extends T> cl,
                                                                         String template, Object... args) {
        return dateTemplate(cl, createTemplate(template), ImmutableList.copyOf(args));
    }
524099
public static Object formatL(final String template, final Object... args) {
    return new Object() {
      @Override
      public String toString() {
        return format(template, args);
      }
    };
  }
708231
static ExpressionCompiler create(
      ExpressionDetacher.Factory detacherFactory,
      TemplateParameterLookup parameters,
      TemplateVariableManager varManager,
      ErrorReporter reporter,
      SoyTypeRegistry registry) {
    return new ExpressionCompiler(detacherFactory, parameters, varManager, reporter, registry);
  }
200823
public static TemplateMetadata fromTemplate(TemplateNode template) {
    TemplateMetadata.Builder builder =
        builder()
            .setTemplateName(template.getTemplateName())
            .setSourceLocation(template.getSourceLocation())
            .setSoyFileKind(SoyFileKind.SRC)
            .setContentKind(template.getContentKind())
            .setStrictHtml(template.isStrictHtml())
            .setDelPackageName(template.getDelPackageName())
            .setVisibility(template.getVisibility())
            .setParameters(Parameter.directParametersFromTemplate(template))
            .setDataAllCallSituations(DataAllCallSituation.fromTemplate(template));
    switch (template.getKind()) {
      case TEMPLATE_BASIC_NODE:
        builder.setTemplateKind(Kind.BASIC);
        break;
      case TEMPLATE_DELEGATE_NODE:
        builder.setTemplateKind(Kind.DELTEMPLATE);
        TemplateDelegateNode deltemplate = (TemplateDelegateNode) template;
        builder.setDelTemplateName(deltemplate.getDelTemplateName());
        builder.setDelTemplateVariant(deltemplate.getDelTemplateVariant());
        break;
      case TEMPLATE_ELEMENT_NODE:
        builder.setTemplateKind(Kind.ELEMENT);
        break;
      default:
        throw new AssertionError("unexpected template kind: " + template.getKind());
    }
    return builder.build();
  }
411511
public static <T> TemplateExpression<T> template(Class<? extends T> cl, String template, Object... args) {
        return template(cl, TemplateFactory.DEFAULT.create(template), ImmutableList.copyOf(args));
    }
1290233
def make_template(name, func, *args, **kwargs):
  """"""
  if args or kwargs:
    func = functools.partial(func, *args, **kwargs)
  return Template(name, func)
1117946
def _build_new_template(self, stack, parameters):
        
        log_lines = ["New template parameters:"]
        for param in sorted(parameters,
                            key=lambda param: param['ParameterKey']):
            log_lines.append("%s = %s" % (param['ParameterKey'],
                                          param['ParameterValue']))

        log_lines.append("\nNew template contents:")
        log_lines.append("".join(stack))
        return log_lines
561111
public static StringTemplate stringTemplate(Template template, Object... args) {
        return stringTemplate(template, ImmutableList.copyOf(args));
    }
45948
public static <T extends Comparable<?>> ComparableTemplate<T> comparableTemplate(Class<? extends T> cl,
            String template, Object... args) {
        return comparableTemplate(cl, createTemplate(template), ImmutableList.copyOf(args));
    }
625345
public TemplateHelper cls(String name) {
        String newClassName = name + "$" + COUNT.getAndIncrement();

        thisClass = pool.makeClass(newClassName);
        className = thisClass.getSimpleName();

        return this;
    }
1039544
@SafeVarargs
    public static <S, E extends Event> InputMapTemplate<S, E> sequence(InputMapTemplate<S, ? extends E>... templates) {
        return new TemplateChain<>(templates);
    }
4859
function compile(tmpl, conf) {
  const c = Object.assign(
    {},
    settings,
    conf,
  );

  const template = new LayoutTemplate({
    conf: c,
    tmpl,
  });

  return bracket.compile(
    template.compile(),
    template.conf,
  );
}
933835
public static void renderTemplateAsExcel(String templateName, Object... args) {

		// Template datas
		Scope.RenderArgs templateBinding = Scope.RenderArgs.current();
		for (Object o : args) {
			List<String> names = LocalvariablesNamesEnhancer.LocalVariablesNamesTracer
					.getAllLocalVariableNames(o);
			for (String name : names) {
				templateBinding.put(name, o);
			}
		}
		templateBinding.put("session", Scope.Session.current());
		templateBinding.put("request", Http.Request.current());
		templateBinding.put("flash", Scope.Flash.current());
		templateBinding.put("params", Scope.Params.current());
		if (null == templateBinding.get("fileName")) {
			templateBinding.put("fileName", templateName.substring(templateName.lastIndexOf("/") + 1) + ".xls");
		}
		//Logger.trace("fileName: " + templateBinding.get("fileName"));
		try {
			templateBinding.put("errors", Validation.errors());
		} catch (Exception ex) {
			throw new UnexpectedException(ex);
		}
		try {
			throw new RenderExcelTemplate(templateName + ".xls", templateBinding.data, templateBinding.get("fileName").toString());
		} catch (TemplateNotFoundException ex) {
			if (ex.isSourceAvailable()) {
				throw ex;
			}
			StackTraceElement element = PlayException
					.getInterestingStrackTraceElement(ex);
			if (element != null) {
				throw new TemplateNotFoundException(templateName, Play.classes
						.getApplicationClass(element.getClassName()), element
						.getLineNumber());
			} else {
				throw ex;
			}
		}
	}
642667
public static <T extends Comparable<?>> TimeTemplate<T> timeTemplate(Class<? extends T> cl,
                                                                           String template, Object... args) {
        return timeTemplate(cl, createTemplate(template), ImmutableList.copyOf(args));
    }
322993
public static <T extends Number & Comparable<?>> NumberTemplate<T> numberTemplate(Class<? extends T> cl, String template, List<?> args) {
        return numberTemplate(cl, createTemplate(template), args);
    }