template that produces error message
194007
function(errors) {
      var
        html = '<ul class="list">'
      ;
      $.each(errors, function(index, value) {
        html += '<li>' + value + '</li>';
      });
      html += '</ul>';
      return $(html);
    }
1130935
def template(template_name, *, app_key=APP_KEY, encoding='utf-8', status=200):
    

    def wrapper(func):
        @functools.wraps(func)
        async def wrapped(*args, **kwargs):
            if asyncio.iscoroutinefunction(func):
                coro = func
            else:
                coro = asyncio.coroutine(func)
            context = await coro(*args, **kwargs)
            if isinstance(context, web.StreamResponse):
                return context

            if 'request' in kwargs:
                request = kwargs['request']
            elif not args:
                request = None
                warnings.warn("Request not detected")
            elif isinstance(args[0], AbstractView):
                request = args[0].request
            else:
                request = args[-1]

            response = render_template(template_name, request, context,
                                       app_key=app_key, encoding=encoding)
            response.set_status(status)
            return response
        return wrapped
    return wrapper
230302
function ModelAPIError(code, message, errors) {
  var err;
  if (message instanceof Error) err = message;
  else err = new Error(message);
  err.__proto__ = ModelAPIError.prototype;
  Object.defineProperty(err, 'code', {
    enumerable: true,
    value: code,
    writeable: false
  });
  if (typeof message === 'string') {
    Object.defineProperty(err, 'message', {
      enumerable: true,
      value: message,
      writeable: false
    });
  }
  if (errors) {
    Object.defineProperty(err, 'errors', {
      enumerable: true,
      value: errors,
      writeable: false
    });
  }
  return err;
}
476453
function unexpectedTokenError(token, message) {
        var value, msg = message || Messages.UnexpectedToken;

        if (token) {
            if (!message) {
                msg = (token.type === Token.EOF) ? Messages.UnexpectedEOS :
                    (token.type === Token.Identifier) ? Messages.UnexpectedIdentifier :
                    (token.type === Token.NumericLiteral) ? Messages.UnexpectedNumber :
                    (token.type === Token.StringLiteral) ? Messages.UnexpectedString :
                    (token.type === Token.Template) ? Messages.UnexpectedTemplate :
                    Messages.UnexpectedToken;

                if (token.type === Token.Keyword) {
                    if (isFutureReservedWord(token.value)) {
                        msg = Messages.UnexpectedReserved;
                    } else if (strict && isStrictModeReservedWord(token.value)) {
                        msg = Messages.StrictReservedWord;
                    }
                }
            }

            value = (token.type === Token.Template) ? token.value.raw : token.value;
        } else {
            value = 'ILLEGAL';
        }

        msg = msg.replace('%0', value);

        return (token && typeof token.lineNumber === 'number') ?
            createError(token.lineNumber, token.start, msg) :
            createError(scanning ? lineNumber : lastLineNumber, scanning ? index : lastIndex, msg);
    }
1140477
function template(str, params){
  return str.replace(/%(\w*)%/g, function(m, key){
    return params[key];
  });
}
1346965
function (subTplName, callback) {
            var tpl = S.require(subTplName);
            if (tpl) {
                callback(undefined, tpl);
            } else {
                var warning = 'template "' + subTplName + '" does not exist, ' + 'better required or used first for performance!';
                S.log(warning, 'error');
                callback(warning, undefined);
            }
        }
399586
function renderTemplate(template, context) {
    var esc = $(document.createElement('div'));

    function handle(ph, escape) {
      var cur = context;
      $.each(ph.split('.'), function() {
        cur = cur[this];
      });
      return escape ? esc.text(cur || "").html() : cur;
    }

    return template.replace(/<([%#])([\w\.]*)\1>/g, function() {
      return handle(arguments[2], arguments[1] == '%' ? true : false);
    });
  }
565361
function template(tmpl, context) {
			return tmpl.replace(/\{([^\}]+)\}/g, function(m, key) {
				return context[key];
			});
		}
1049396
def template_exception_handler(fn, error_context, filename=None):
    """"""
    error_message = None
    if filename:
        error_context.update(filename=filename)
    try:
        return fn()
    except jinja2.TemplateSyntaxError as exc:
        error_context.update(filename=exc.filename, line_no=exc.lineno)
        error_message = exc.message
    except jinja2.TemplateError as exc:
        error_message = exc.message
    except Exception as exc:
        error_message = "%s" % exc

    raise TemplateError(message=error_message, context=error_context)
639994
function AssertionFailedError(params, template) {
  this.params = params;
  this.template = template;
  // this.message = "AssertionFailedError";
  let stack = new Error().stack;
  // this.showDiff = true;
  stack = stack ? stack.split('\n').filter(line =>
    // @todo cut assert things nicer
    line.indexOf('lib/assert') < 0).join('\n') : '';
  this.showDiff = true;

  this.actual = this.params.actual;
  this.expected = this.params.expected;

  this.inspect = () => {
    const params = this.params || {};
    const msg = params.customMessage || '';
    return msg + subs(this.template, params);
  };

  this.cliMessage = () => this.inspect();
}
16511
function(message) {

    // If an error already has been thrown, exit
    if (errorTarget) return message

    utils.doCallback('errorTriggered', message);
    utils.logError(message)

    // If no target DOM element exists, only do the logging
    if (!rootTarget) return message

    var messageProcessed = message
    var contextProcessed = null

    if (utils.isArray(message)) {
      messageProcessed = message[0]
      if (message[1].data) {
        contextProcessed = stringify(message[1].data.errors || message[1].data.error || message[1].data)
      } else {
        contextProcessed = stringify(message[1])
      }
    }

    var template = require('./templates/error.html');
    errorTarget = $(template.render({
      errorWarningIcon: require('!svg-inline!./assets/error-warning-icon.svg'),
      message: messageProcessed,
      context: contextProcessed
    }));

    rootTarget.append(errorTarget);

    return message

  }
1365331
function (context, next) {
        if (context.cached.error)
            return next(context.cached.error);
        if (!context.cached.template)
            return next(new errors.Internal("For unknowns reasons, the template couldn't have been processed."));

        var opts = {
            requests: context.cached.requests,
            template: context.cached.template,
            context: context.options.solidifyContext,
            host: this.options.host,
            sessionID: context.options.sessionID
        };

        // solidify the template by feeding it.
        return this._solidify.feed(opts, function (err, result) {
            if (err)
                return next(new errors.Internal('Solidify error: ' + err.message));
            context.solidified = result;
            next(null);
        });
    }
114492
function(template, data){

    if (!template) {
      var error = new Error("Cannot render the template since it's false, null or undefined.");
      error.name = "TemplateNotFoundError";
      throw error;
    }

    var templateFunc;
    if (typeof template === "function"){
      templateFunc = template;
    } else {
      templateFunc = Marionette.TemplateCache.get(template);
    }

    return templateFunc(data);
  }
34262
function logMessage (message, data) {
  if (!message) return
  render(message, data, (err, res) => {
    if (err) {
      console.error('\n   Error when rendering template complete message: ' + err.message.trim())
    }
    else {
      console.log('\n' + res.split(/\r?\n/g).map(line => '   ' + line).join('\n'))
    }
  })
}
1084512
def call_template(self, template):
        '''
        
        '''
        high = compile_template(template,
                                self.rend,
                                self.opts['renderer'],
                                self.opts['renderer_blacklist'],
                                self.opts['renderer_whitelist'])
        if not high:
            return high
        high, errors = self.render_template(high, template)
        if errors:
            return errors
        return self.call_high(high)
631618
def _validate_templates(self, templates):
        
        if templates is None:
            return templates

        if not isinstance(templates, list):
            raise TypeError(logger.error("templates should be a list."))

        for template in templates:
            if not isinstance(template, dict):
                raise TypeError(logger.error("each item to be injected must be a dict."))

            if template.get('notifications'):
                for level, notification in six.iteritems(template.get('notifications')):
                    if level == 'errors':
                        logger.error(
                            "errors were returned during the injection process. errors: {0}".format(notification),
                            extra={"container": 'injector'}
                        )
                        raise Exception(notification)

            for key in ('user', 'name', 'group', 'chmod', 'config_path', 'path', 'checksum'):
                if key not in template:
                    raise KeyError(logger.error("The injector didn't return a {0}.".format(key)))

        return templates
490849
def render_to_string(self, *args, **kwargs):
        """"""
        try:
            template_name, args = args[0], args[1:]
        except IndexError:
            raise TypeError('name of template required')
        return self.get_template(template_name).render(*args, **kwargs)