Create all that is need it to send messages to Dispatch SNS
Resources created by this function are

- HasDispatchSnsArn conditional
- DispatchSnsArn parameter
- LambdaCfnDispatchRole

@param template
@param options
18667
function addDispatchSupport(template, options) {
  if (!template.Conditions) {
    template.Conditions = {};
  }

  if (!('HasDispatchSnsArn' in template.Conditions)) {
    template.Conditions['HasDispatchSnsArn'] = {
      'Fn::Not': [
        {
          'Fn::Equals': [
            '',
            cf.ref('DispatchSnsArn')
          ]
        }
      ]
    };
  }

  template.Parameters.DispatchSnsArn = {
    Type: 'String',
    Description: 'Dispatch SNS ARN (Optional)'
  };

  // Why we need other role for Dispatch?
  // We can not use conditionals at policy level. We create a new role with all the properties of the
  // default role plus the conditional and policy to send messages to DispatchSnsArn.
  let dispatchRole = role.buildRole(options, 'LambdaCfnDispatchRole');
  template.Resources['LambdaCfnDispatchRole'] = dispatchRole.Resources['LambdaCfnDispatchRole'];
  template.Resources['LambdaCfnDispatchRole'].Condition = 'HasDispatchSnsArn';
  template.Resources['LambdaCfnDispatchRole'].Properties.Policies[0].PolicyDocument.Statement.push(
    {
      Effect: 'Allow',
      Action: [
        'sns:Publish'
      ],
      Resource: cf.ref('DispatchSnsArn')
    }
  );
}
199147
private TeaServletTemplateSource createTemplateSource(
                                         ContextSource contextSource) {
        return TeaServletTemplateSource.createTemplateSource(
            getServletContext(),
            (TeaServletContextSource) contextSource,
            getProperties().subMap("template"),
            getLog());
    }
509595
public void addTemplate(String template) {
	  if (lock == SET) {
		 throw new IllegalStateException("EntryInfo is locked");
	  }
	  if (template != null && !template.equals("")) {
		  templates.add(template);
	  }
   }
496611
public Context setTemplate(Template template) {
        checkThread();
        if (template != null) {
            setEngine(template.getEngine());
        }
        this.template = template;
        return this;
    }
108898
function(options)
	{
		var args = conbo.toArray(arguments);
		
		if (args[0] === undefined) 
		{
			args[0] = {};
		}
		else if (args[0] instanceof conbo.Context && conbo.is(this, conbo.IInjectable, false)) 
		{
			args[0] = args[0].addTo();
		}
		
		this.declarations.apply(this, args);
		
		if (!!args[0].context)
		{
			this.context = args[0].context;
		}
	
		if (this instanceof conbo.EventDispatcher)
		{
			this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.PREINITIALIZE));
		}

		this.preinitialize.apply(this, args);
		this.__construct.apply(this, args);
		
		if (this instanceof conbo.EventDispatcher)
		{
			this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.INITIALIZE));
		}

		this.initialize.apply(this, args);
		conbo.makeAllBindable(this, this.bindable);
		this.__postInitialize.apply(this, args);
		
		if (this instanceof conbo.EventDispatcher)
		{
			this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.INIT_COMPLETE));
		}		
	}
1219135
@Deprecated
    public static <T extends Enum<T>> EnumTemplate<T> enumTemplate(Class<? extends T> cl,
                                                                     String template, ImmutableList<?> args) {
        return enumTemplate(cl, createTemplate(template), args);
    }
145999
public void updateComponentDumpTemplate(String template) throws SecurityException {
	checkWriteAccess();
	boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
	if (!hasAccess) throw new SecurityException("no access to update component setting");

	Element component = _getRootElement("component");
	// if(template.trim().length()>0)
	component.setAttribute("dump-template", template);
    }
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);
      }
    }
  }
1110853
public static <T extends Number & Comparable<?>> NumberTemplate<T> numberTemplate(Class<? extends T> cl, Template template, List<?> args) {
        return new NumberTemplate<T>(cl, template, ImmutableList.copyOf(args));
    }
1019458
public static <T> DslTemplate<T> dslTemplate(Class<? extends T> cl, String template, List<?> args) {
        return dslTemplate(cl, createTemplate(template), args);
    }
161440
public static TemplateMessageResult messageTemplateSend(String access_token, TemplateMessage templateMessage) {
        String messageJson = JsonUtil.toJSONString(templateMessage);
        HttpUriRequest httpUriRequest = RequestBuilder.post()
                .setHeader(jsonHeader)
                .setUri(BASE_URI + "/cgi-bin/message/template/send")
                .addParameter(PARAM_ACCESS_TOKEN, API.accessToken(access_token))
                .setEntity(new StringEntity(messageJson, Charset.forName("utf-8")))
                .build();
        return LocalHttpClient.executeJsonResult(httpUriRequest, TemplateMessageResult.class);
    }
96644
public static PredicateTemplate predicateTemplate(String template, List<?> args) {
        return predicateTemplate(TemplateFactory.DEFAULT.create(template), args);
    }
859229
public boolean exec(TemplateNode template) {

    boolean hasOptional = false;
    for (TemplateParam param : template.getParams()) {
      if (param.isRequired()) {
        // If there exists a required param, then data should already be defined (no need to
        // ensure).
        return false;
      } else {
        hasOptional = true;
      }
    }
    if (hasOptional) {
      // If all params are optional (and there is at least one), then we need to ensure data is
      // defined.  This is because the only legal way to have an optional param is if you reference
      // it somewhere in the template, so there is no need to check.
      return true;
    }
    // If we get here then the template has no declared params and we are observing a v1 compatible
    // template.  Search for things that could be data references:
    // * possibleParams
    // * data=All calls
    // others?
    return new AbstractNodeVisitor<Node, Boolean>() {
      boolean shouldEnsureDataIsDefined;

      @Override
      public Boolean exec(Node node) {
        visit(node);
        return shouldEnsureDataIsDefined;
      }

      @Override
      public void visit(Node node) {
        if (node instanceof VarRefNode) {
          VarRefNode varRefNode = (VarRefNode) node;
          VarDefn var = varRefNode.getDefnDecl();
          // Don't include injected params in this analysis
          if (varRefNode.isPossibleHeaderVar()
              && var.kind() != VarDefn.Kind.STATE
              && (var.kind() != VarDefn.Kind.PARAM // a soydoc param -> not ij
                  || !((TemplateParam) var).isInjected())) { // an {@param but not {@inject
            shouldEnsureDataIsDefined = true;
            return;
          }
        }
        if (node instanceof CallNode) {
          if (((CallNode) node).isPassingAllData()) {
            shouldEnsureDataIsDefined = true;
            return;
          }
        }
        if (node instanceof ParentNode) {
          for (Node child : ((ParentNode<?>) node).getChildren()) {
            visit(child);
            if (shouldEnsureDataIsDefined) {
              return;
            }
          }
        }
        if (node instanceof ExprHolderNode) {
          for (ExprRootNode expr : ((ExprHolderNode) node).getExprList()) {
            visit(expr);
            if (shouldEnsureDataIsDefined) {
              return;
            }
          }
        }
      }
    }.exec(template);
  }
365579
public static <T extends Enum<T>> EnumTemplate<T> enumTemplate(Class<? extends T> cl,
                                                                     String template, Object... args) {
        return enumTemplate(cl, createTemplate(template), ImmutableList.copyOf(args));
    }
978600
public static <T extends Comparable<?>> DateTimeTemplate<T> dateTimeTemplate(Class<? extends T> cl, String template, List<?> args) {
        return dateTimeTemplate(cl, createTemplate(template), args);
    }
1203369
def template(self, lambda_arn, role_arn, output=None, json=False):
        

        if not lambda_arn:
            raise ClickException("Lambda ARN is required to template.")

        if not role_arn:
            raise ClickException("Role ARN is required to template.")

        self.zappa.credentials_arn = role_arn

        # Create the template!
        template = self.zappa.create_stack_template(
                                            lambda_arn=lambda_arn,
                                            lambda_name=self.lambda_name,
                                            api_key_required=self.api_key_required,
                                            iam_authorization=self.iam_authorization,
                                            authorizer=self.authorizer,
                                            cors_options=self.cors,
                                            description=self.apigateway_description,
                                            policy=self.apigateway_policy,
                                            endpoint_configuration=self.endpoint_configuration
                                        )

        if not output:
            template_file = self.lambda_name + '-template-' + str(int(time.time())) + '.json'
        else:
            template_file = output
        with open(template_file, 'wb') as out:
            out.write(bytes(template.to_json(indent=None, separators=(',',':')), "utf-8"))

        if not json:
            click.echo(click.style("Template created", fg="green", bold=True) + ": " + click.style(template_file, bold=True))
        else:
            with open(template_file, 'r') as out:
                print(out.read())
1275042
public static <T extends Enum<T>> EnumTemplate<T> enumTemplate(Class<? extends T> cl, String template, List<?> args) {
        return enumTemplate(cl, createTemplate(template), args);
    }