Decorate expression text with a call to a guard function.
3669
function addGuard(guard, expr) {
      let safeExpr = null;
      if (!isWellFormed(expr)) {
        expr = '{/*Malformed Expression*/}';
      }
      needsRuntime = true;
      safeExpr = ` rt_${ unpredictableSuffix }.${ guard }(${ expr }) `;
      return safeExpr;
    }
814128
def op(cls,text,*args,**kwargs):
        
        return cls.fn(text,*args,**kwargs)
1176365
function decorate (fn) {
  return async function (...args) {
    try {
      return fn.call(this, ...args);
    } catch (err) {
      this.logger && this.logger.error(err.message);
      throw err;
    }
  };
}
872823
function applyClassDecorators(classPath) {
  if (!hasClassDecorators(classPath.node)) return;

  const decorators = classPath.node.decorators || [];
  classPath.node.decorators = null;

  const name = classPath.scope.generateDeclaredUidIdentifier("class");

  return decorators
    .map(dec => dec.expression)
    .reverse()
    .reduce(function(acc, decorator) {
      return buildClassDecorator({
        CLASS_REF: t.cloneNode(name),
        DECORATOR: t.cloneNode(decorator),
        INNER: acc,
      }).expression;
    }, classPath.node);
}
492351
def wrap (text, width, **kwargs):
    """"""
    if width <= 0 or not text:
        return text
    ret = []
    for para in get_paragraphs(text):
        text = " ".join(para.strip().split())
        ret.extend(textwrap.wrap(text, width, **kwargs))
    return os.linesep.join(ret)
625751
def apply(cls, text, mode):
        
        if mode == cls.SCREAMING_SNAKE_CASE:
            return cls._screaming_snake_case(text)
        elif mode == cls.snake_case:
            return cls._snake_case(text)
        elif mode == cls.lowercase:
            return cls._snake_case(text).replace('_', '')
        elif mode == cls.lowerCamelCase:
            return cls._camel_case(text)
        elif mode == cls.CamelCase:
            return cls._camel_case(text, True)
        elif callable(mode):
            return mode(text)
        return text
19255
function tokenizeEscape(match, value) {
    var index = tokenized.length;
    tokenized[index] = "'+\n_.escape(" + value + ") +\n'";
    return token + index;
  }
1321871
function ontext(template, text, config) {
	var
		blockStubPos = -1,
		cursor = 0,
		children = null,
		nodes = []
	;
	
	config = extend({virtual: template.virtual}, config);

	// Ensures that consecutive textOnly components are merged into a single VText node
	function concatText(text) {
		if ((nodes.length > 0) && nodes[nodes.length - 1].addText) {
			nodes[nodes.length - 1].addText(text);
		} else {
			nodes.push(new VText(text, config));
		}
	}

	// DRY parse
	function concatInterpolatedContent(content) {
		Expression.parseInterpolated(content, {
			ontext: function(text) {
				concatText(text);
			},
			onexpression: function(expr) {
				if (expr.textOnly || (config.virtual === false)) {
					concatText(expr);
				} else {
					nodes.push(expr);
				}
			}
		});
	}

	// While we find more interpolated handlebars blocks
	while ((blockStubPos = text.indexOf(_blockStub, cursor)) > -1) {

		// Get pre-text
		if (blockStubPos > cursor) {
			concatInterpolatedContent(text.substr(cursor, blockStubPos - cursor));
		}

		// Add the block to the list of nodes
		block = template.blocks.shift();
		if (config.virtual === false) {
			block.callback.virtual = false;
			concatText(block);
		} else {
			nodes.push(block);
		}

		// Advance the cursor
		cursor = blockStubPos + _blockStub.length;
	}

	// Get post-text (or the only text)
	if (cursor < text.length) {
		concatInterpolatedContent(text.substr(cursor));
	}

	// textOnly is for things like tagName and attribute values
	return nodes;
}
1239127
def _wrap_set_op(self, fun, arg):
        """"""
        result = fun(self, arg)
        result._autostep = self._autostep
        result.padding = self.padding
        return result
113175
def process_token(self, tok):
        """"""
        if tok[0] == Token.Text:
            count = tok[1].count('\n')
            if count:
                self._line += count  # adjust linecount

        if self._detector.process(tok):
            pass  # works been completed in the detector
        elif tok[0] == Token.Punctuation:
            if tok[0] == Token.Punctuation and tok[1] == '{':
                self._scope += 1
            if tok[0] == Token.Punctuation and tok[1] == '}':
                self._scope += -1
                if self._scope == 0 and self._curr is not None:
                    self._curr['end'] = self._line  # close last scope
                    self._curr = None
        elif tok[0] == Token.Name.Class and self._scope == 0:
            self.add_scope('Class', tok[1], self._line)
        elif tok[0] == Token.Name.Function and self._scope in [0, 1]:
            self.add_scope('Function', tok[1], self._line, self._scope == 1)
963409
def something(TokenClass):
    """"""
    def callback(lexer, match, context):
        text = match.group()
        if not text:
            return
        yield match.start(), TokenClass, text
        context.pos = match.end()
    return callback
413620
function wrap (str, quote) {
    if (this.typecheck) t.typecheck('wrap', [str, quote]);
    if (!quote||quote=="'") return "'"+str+"'";
    if (quote == '"') return '"'+str+'"';
    return quote+str+quote;
}
1374655
def decorate(self, func, limit, ttl, *anoop, **kwnoop):
        """"""
        return super(ratelimit, self).decorate(func, limit, ttl, *anoop, **kwnoop)
248556
def _exception_gather_guard(self, fn):
        

        @functools.wraps(fn)
        def wrapper(*args, **kwargs):
            try:
                return fn(*args, **kwargs)
            except UserException as e:
                self.exceptions.append(e)

        return wrapper
1118763
def decorator_handle(tokens):
    """"""
    defs = []
    decorates = []
    for i, tok in enumerate(tokens):
        if "simple" in tok and len(tok) == 1:
            decorates.append("@" + tok[0])
        elif "test" in tok and len(tok) == 1:
            varname = decorator_var + "_" + str(i)
            defs.append(varname + " = " + tok[0])
            decorates.append("@" + varname)
        else:
            raise CoconutInternalException("invalid decorator tokens", tok)
    return "\n".join(defs + decorates) + "\n"
33559
def visit_decorators(self, node):
        """"""
        return "@%s\n" % "\n@".join(item.accept(self) for item in node.nodes)
194208
def decorate(self, fun):
        """"""
        @wraps(fun)
        def _decorated(*args, **kwargs):
            # Push the config, run the function and pop it afterwards.
            self.push_config()
            try:
                return fun(*args, **kwargs)
            finally:
                self.pop_config()
        return _decorated