This method functions as a template method (design pattern).
546530
@Override
    public final void execute(Tuple tuple, BasicOutputCollector collector) {
        if (TupleUtils.isTick(tuple)) {
            getLogger().debug("Received tick tuple, triggering emit of current rankings");
            emitRankings(collector);
        } else {
            updateRankingsWithTuple(tuple);
        }
    }
990175
public static PredicateTemplate predicateTemplate(Template template, Object... args) {
        return predicateTemplate(template, ImmutableList.copyOf(args));
    }
103993
function () {

        RemoteObjectTemplate.lazyTemplateLoad = this.config.lazyTemplateLoad;

            // Graph of mixins so we can process them at the end
        var mixinGraph = {};

        if (module.exports.objectTemplateInitialize) {
            module.exports.objectTemplateInitialize(RemoteObjectTemplate);
        }

        var objectTemplateSubClass = Object.create(RemoteObjectTemplate);
        var currentContext = {pass: 1};


        if (this.config.templateMode == 'typescript') {
        }
        else if (this.config.templateMode == 'auto') {

            var deferredExtends = [];
            RemoteObjectTemplate.__statics__ = {};

            usesV2ReturnPass1.prototype.mixin = function () {};

            usesV2ReturnPass1.prototype.extend = function(name) {
                this.extendedName = name;
                deferredExtends.push(this);

                return new usesV2ReturnPass1(name);
            };

            usesV2ReturnPass1.prototype.doExtend = function(futureTemplates) {
                if (!RemoteObjectTemplate.__dictionary__[this.baseName]) {
                    if (futureTemplates[this.baseName]) {
                        futureTemplates[this.baseName].doExtend(futureTemplates);
                    }

                    if (!RemoteObjectTemplate.__dictionary__[this.baseName]) {
                        throw Error('Attempt to extend ' + this.baseName + ' which was never defined; extendedName=' + this.extendedName);
                    }
                }

                if (!RemoteObjectTemplate.__dictionary__[this.extendedName]) {
                    var template = RemoteObjectTemplate.__dictionary__[this.baseName].extend(this.extendedName, {});
                }
            };

            for (var exp in module.exports || {}) {
                if (!exp.match(/_mixins/)) {
                    objectTemplateSubClass.create = function (name) {
                        var template = RemoteObjectTemplate.create(name, {});
                        var originalExtend = template.extend;

                        template.extend = function (name, props)  {
                            var template = RemoteObjectTemplate.__dictionary__[name];

                            if (template) {
                                template.mixin(props);
                            }
                            else {
                                template = originalExtend.call(this, name, props);
                            }

                            return template;
                        };

                        var originalMixin = template.mixin;

                        template.mixin = function () {
                            if (currentContext.pass === 2) {
                                if (arguments[0] && arguments[0].isObjectTemplate) {
                                    scheduleDeferredMixinProcessing(template, arguments[0]);
                                }
                                else {
                                    originalMixin.apply(template, arguments);
                                }
                            }
                        };

                        return template;
                    };

                    var initializerReturnValues = (module.exports[exp])(objectTemplateSubClass, usesV2Pass1);

                    recordStatics(initializerReturnValues);
                }
            }

                // Extended classes can't be processed until now when we know we have all the base classes defined
            var futureTemplates = {};

            for (var ix = 0; ix < deferredExtends.length; ++ix) {
                futureTemplates[deferredExtends[ix].extendedName] = deferredExtends[ix];
            }

            for (var ix = 0; ix < deferredExtends.length; ++ix) {
                deferredExtends[ix].doExtend(futureTemplates);
            }

            currentContext.pass = 2;

            var objectTemplateSubClass = Object.create(RemoteObjectTemplate);

            for (var exp in module.exports) {
                objectTemplateSubClass.create = function (name, props) {
                    if (RemoteObjectTemplate.__dictionary__[name.name || name]) {
                        RemoteObjectTemplate.__dictionary__[name.name || name].mixin(props);
                    }
                    else {
                        RemoteObjectTemplate.create(name, props);
                    }

                    return RemoteObjectTemplate.__dictionary__[name.name || name];
                };

                var initializerReturnValues;

                if (this.config && this.config.modules) {
                    initializerReturnValues = (module.exports[exp])(objectTemplateSubClass, usesV2Pass2, this.config.modules[exp.replace(/_mixins/, '')]);
                }
                else {
                    initializerReturnValues = (module.exports[exp])(objectTemplateSubClass, usesV2Pass2, null);
                }

                recordStatics(initializerReturnValues);
            }

            processDeferredMixins();

            for (var name in RemoteObjectTemplate.__dictionary__) {
                window[name] = RemoteObjectTemplate.__dictionary__[name];
            }

            for (var name in RemoteObjectTemplate.__statics__) {
                window[name] = RemoteObjectTemplate.__statics__[name];
            }
        }
        else {
            var requires = {};

            for (var exp in module.exports || {}) {
                if (!exp.match(/_mixins/)) {
                    var templates = (module.exports[exp])(RemoteObjectTemplate, function () {
                        return window;
                    });

                    requires[exp] = templates;

                    for (var template in  templates) {
                        window[template] = templates[template];
                    }
                }
            }

            var templates = flatten(requires);

            for (var exp in module.exports) {
                if (exp.match(/_mixins/)) {

                    if (this.config) {
                        templates = (module.exports[exp])(RemoteObjectTemplate, requires, this.config.modules[exp.replace(/_mixins/, '')], templates);
                    }
                    else {
                        templates = (module.exports[exp])(RemoteObjectTemplate, requires, null, templates);
                    }

                    for (var template in  templates) {
                        window[template] = templates[template];
                    }
                }
            }
        }

        RemoteObjectTemplate.performInjections();

        function flatten (requires) {
            var classes = {};

            for (var f in requires) {
                for (var c in requires[f]) {
                    classes[c] = requires[f][c];
                }
            }

            return classes;
        }

        function usesV2Pass1 (file, templateName, options) {
            var templateName = templateName || file.replace(/\.js$/, '').replace(/.*?[\/\\](\w)$/, '$1');
            var staticTemplate = RemoteObjectTemplate.__statics__[templateName];

            return staticTemplate || new usesV2ReturnPass1(templateName);
        }

        function usesV2Pass2 (file, templateName, options) {
            var templateName = templateName || file.replace(/\.js$/, '').replace(/.*?[\/\\](\w)$/, '$1');

            return RemoteObjectTemplate.__dictionary__[templateName] || RemoteObjectTemplate.__statics__[templateName];
        }

            // An object for creating request to extend classes to be done at thend of V2 pass1
        function usesV2ReturnPass1 (base) {
            this.baseName = base;
        }
        function scheduleDeferredMixinProcessing(template, mixinTemplate) {
            mixinGraph[template.__name__] =  mixinGraph[template.__name__] || {};
            mixinGraph[template.__name__][mixinTemplate.__name__] = true;
        }

        function processDeferredMixins() {

                // Go through each template that needs a mixin
            for (var rootMixin in mixinGraph) {
                processRootMixin(mixinGraph[rootMixin], rootMixin);
            }

            function processRootMixin(rootMixin, rootMixinTemplateName) {

                    // Go through each of the templates that needs to be mixed in
                for (var childMixin in rootMixin) {
                    processChildMixin(childMixin);
                }

                function processChildMixin(childMixinTemplateName) {

                        // that template that needs to be mixed in also needs mixins, process them first
                    if (mixinGraph[childMixinTemplateName]) {
                        processRootMixin(mixinGraph[childMixinTemplateName], childMixinTemplateName);
                        mixinGraph[childMixinTemplateName] = {};  // Make sure we don't process twice
                    }
                        // Now we can safely do the mixin
                    RemoteObjectTemplate.mixin(RemoteObjectTemplate.__dictionary__[rootMixinTemplateName],
                            RemoteObjectTemplate.__dictionary__[childMixinTemplateName]);
                }
            }
        }

        function recordStatics(initializerReturnValues) {
            for (var returnVariable in initializerReturnValues)                    {
                if (!RemoteObjectTemplate.__dictionary__[returnVariable]) {
                    if (RemoteObjectTemplate.__statics__[returnVariable]) {
                        var staticProps = Object.getOwnPropertyNames(RemoteObjectTemplate.__statics__[returnVariable]);
                        for (var sx = 0; sx < staticProps.length; ++sx) {
                            RemoteObjectTemplate.__statics__[returnVariable][staticProps[sx]] =
                                    initializerReturnValues[returnVariable][staticProps[sx]];
                        }
                    }
                    else {
                        RemoteObjectTemplate.__statics__[returnVariable] = initializerReturnValues[returnVariable];
                    }
                }
            }
        }

    }
946491
@Nonnull
	public <V extends T> LToIntFunctionBuilder<T> aCase(Class<V> argC, LToIntFunction<V> function) {
		PartialCaseWithIntProduct.The pc = partialCaseFactoryMethod(a -> (argC == null || argC.isInstance(a)));

		pc.evaluate(function);
		return self();
	}
401030
@Nonnull
	public <V extends T> LToByteFunctionBuilder<T> aCase(Class<V> argC, LToByteFunction<V> function) {
		PartialCaseWithByteProduct.The pc = partialCaseFactoryMethod(a -> (argC == null || argC.isInstance(a)));

		pc.evaluate(function);
		return self();
	}
353313
@Deprecated
    public static PredicateTemplate predicateTemplate(String template, ImmutableList<?> args) {
        return predicateTemplate(TemplateFactory.DEFAULT.create(template), args);
    }
542390
private void process() {
    metadataBuilder = ConstructorMetadata.newBuilder().setClazz(clazz);
    MethodHandle mh = IntrospectionUtils.findDefaultConstructor(clazz);
    if (mh != null) {
      metadataBuilder.setConstructionStrategy(ConstructorMetadata.ConstructionStrategy.CLASSIC)
          .setConstructorMethodHandle(mh);
      // We have everything we need for the classic pattern with a default
      // constructor and accessor/mutator methods, more validations will
      // follow.
      return;
    }
    // Now we check for Builder pattern usage
    mh = findNewBuilderMethod(clazz);
    if (mh == null) {
      final String pattern = "Class %s requires a public no-arg constructor or a public static "
          + "method that returns a corresponding Builder instance. The name of the static method "
          + "can either be %s or %s";
      String error = String.format(pattern, clazz.getName(), METHOD_NAME_NEW_BUILDER,
          METHOD_NAME_BUILDER);
      throw new UnsupportedConstructionStrategyException(error);
    }
    Class<?> builderClass = mh.type().returnType();
    metadataBuilder.setConstructionStrategy(ConstructorMetadata.ConstructionStrategy.BUILDER)
        .setConstructorMethodHandle(mh).setBuilderClass(builderClass);
    MethodHandle buildMethodHandle = IntrospectionUtils.findInstanceMethod(builderClass,
        METHOD_NAME_BUILD, clazz);
    if (buildMethodHandle == null) {
      String pattern = "Class %s requires a public instance method, %s, with a return type of %s";
      throw new EntityManagerException(
          String.format(pattern, builderClass.getName(), METHOD_NAME_BUILD, clazz));
    }
    metadataBuilder.setBuildMethodHandle(buildMethodHandle);
  }
655760
function (p, def) {
                // The prototype should be an instance of Template, that inheriths from BaseTemplate
                p.$BaseTemplate.constructor.classDefinition.$prototype.$init(p, def);

                // copy the prototype of ITemplate:
                var itf = ITemplate.prototype;
                for (var key in itf) {
                    if (itf.hasOwnProperty(key) && !p.hasOwnProperty(key)) {
                        // copy methods which are not already on this object (this avoids copying $classpath and
                        // $destructor)
                        p[key] = itf[key];
                    }
                }

                // get shortcuts to necessary functions in other classes,
                // so that templates work even in a sandbox
                p.$json = require('../utils/Json');
            }
1088009
function (p, def) {
            // The prototype should be an instance of Template, that inherits from BaseTemplate
            p.$BaseTemplate.constructor.classDefinition.$prototype.$init(p, def);

            /**
             * This method can be called to process the Text Template: it receives data that the text template has
             * access to, it creates the text template context, and it calls the macro_main of the text template to
             * which the context is associated and it returns a string. It is a property of the constructor because it
             * is not desirable that it ends up in the prototype of the TextTemplate and all of its descendants.
             * @param {Object} data model available to the text template.
             * @return {String}
             */
            aria.templates.TextTemplate.processTextTemplate = function (data) {
                var textContext = new ariaTemplatesTxtCtxt();
                textContext.initTemplate({
                    "classpath" : this.prototype.$classpath,
                    "data" : data
                });
                var stringToReturn = textContext.getTextTemplateContent();
                textContext.$dispose();
                return stringToReturn;
            };

        }
1115314
function (template, data) {
            var p;
            for (p in data) {
                if (data.hasOwnProperty(p)) {
                    template = template.replace(new RegExp('\\{\\{' + p + '\\}\\}', 'g'), data[p]);
                }
            }
            return template;
        }
600034
@Deprecated
    public static <T> DslTemplate<T> dslTemplate(Class<? extends T> cl, Template template, ImmutableList<?> args) {
        return new DslTemplate<T>(cl, template, args);
    }
994663
def as_template(value):
    
    if isinstance(value, Template):
        # If it's already a Template, pass it through.
        return value
    elif isinstance(value, abc.Mapping):
        # Dictionaries work as templates.
        return MappingTemplate(value)
    elif value is int:
        return Integer()
    elif isinstance(value, int):
        return Integer(value)
    elif isinstance(value, type) and issubclass(value, BASESTRING):
        return String()
    elif isinstance(value, BASESTRING):
        return String(value)
    elif isinstance(value, set):
        # convert to list to avoid hash related problems
        return Choice(list(value))
    elif (SUPPORTS_ENUM and isinstance(value, type)
            and issubclass(value, enum.Enum)):
        return Choice(value)
    elif isinstance(value, list):
        return OneOf(value)
    elif value is float:
        return Number()
    elif value is None:
        return Template()
    elif value is dict:
        return TypeTemplate(abc.Mapping)
    elif value is list:
        return TypeTemplate(abc.Sequence)
    elif isinstance(value, type):
        return TypeTemplate(value)
    else:
        raise ValueError(u'cannot convert to template: {0!r}'.format(value))
8104
public final void setTemplate() {
        template = new HashMap();
        if (isEventExist()) {
            template.putAll(events.get(next));
        }
        template.put("event", eventType);
    }
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));
    }
790511
function () {
            aria.widgets.Template.superclass._init.call(this);

            var tplDiv = ariaUtilsDom.getDomElementChild(this._domElt, 0);
            this._subTplDiv = tplDiv;
            var tplCtxt = this.subTplCtxt;

            if (tplCtxt) {
                tplCtxt.linkToPreviousMarkup(tplDiv);

                this.$callback(this.tplLoadCallback, {
                    success : true,
                    templateCtxt : tplCtxt
                });
                tplCtxt.viewReady();
            }

            // Even if not differed yet, it might still be so if its context is not yet ready
            if (!this.isDiffered) {
                // No template context means a template error, let the normal flow handle this case
                this.isDiffered = tplCtxt && !tplCtxt._ready;

                if (this.isDiffered) {
                    tplCtxt.$on({
                        "Ready" : {
                            fn : this.__differedComplete,
                            scope : this
                        }
                    });
                }
            }
        }
1240562
function Templater(options) {
  if (options == null) {
    options = { allowEval: true };
  }
  this.options = options;
  if (options.stack && Array.isArray(options.stack)) {
    this.stack = options.stack;
  }
  else if (typeof options.stack === 'string') {
    this.stack = [ options.stack ];
  }
  else {
    this.stack = [];
  }
  this.nodes = [];
}
1149586
@Deprecated
    public static <T extends Comparable<?>> ComparableTemplate<T> comparableTemplate(Class<? extends T> cl,
                                                                                     Template template, ImmutableList<?> args) {
        return new ComparableTemplate<T>(cl, template, args);
    }