Wrap child in parens only if required to keep same semantics
502207
def _precedence_parens(self, node, child, is_left=True):
        """"""
        if self._should_wrap(node, child, is_left):
            return "(%s)" % child.accept(self)

        return child.accept(self)
1214752
function safeEval(src, parentContext){
  var tree = prepareAst(src)
  var context = Object.create(parentContext || {})
  return finalValue(evaluateAst(tree, context))
}
1106962
function asJSX({attributes, children}, {file: {opts: fileOpts}}, babel) {
  // It's a shame you cannot use evaluate() with JSX
  const string = children[0].node.value
  children[0].replaceWith(
    getReplacement({
      string,
      fileOpts,
      babel,
    }),
  )
  const {
    parentPath: {
      node: {openingElement, closingElement},
    },
  } = children[0]
  openingElement.name.name = 'div'
  closingElement.name.name = 'div'
}
319888
function wrap_cb(fn, P) {
  return function (params) {
    return new P(function (resolve, reject) {
      fn(params, function (err) { return !err ? resolve() : reject(err); });
    });
  };
}
1195208
def _parse_xml(child, parser):
    """"""
    name, modifiers, dtype, kind = _parse_common(child)

    #Handle the symbol modification according to the isense settings.
    name = _isense_builtin_symbol(name)

    if child.tag == "subroutine":
        parent = Subroutine(name, modifiers, None)
    elif child.tag == "function":
        parent = Function(name, modifiers, dtype, kind, None)

    if parent is not None:
        for kid in child:
            if kid.tag == "parameter":
                _parse_parameter(kid, parser, parent)
            elif kid.tag == "summary":
                _parse_summary(kid, parser, parent)
            elif kid.tag == "usage":
                _parse_usage(kid, parser, parent)

    return parent
1360569
private static void formatElseIfClauseWithNoDependencies(
      IfThenPair<?> condition, FormattingContext ctx) {
    ctx.append(" else if (").appendOutputExpression(condition.predicate).append(") ");
    try (FormattingContext ignored = ctx.enterBlock()) {
      ctx.appendAll(condition.consequent);
    }
  }
159595
function maintain_this_binding(parent, orig, val) {
        if (parent instanceof AST_UnaryPrefix && parent.operator == "delete"
            || parent instanceof AST_Call && parent.expression === orig
                && (val instanceof AST_PropAccess || val instanceof AST_SymbolRef && val.name == "eval")) {
            return make_node(AST_Seq, orig, {
                car: make_node(AST_Number, orig, {
                    value: 0
                }),
                cdr: val
            });
        }
        return val;
    }
1135058
def prepend(self, _, child, name=None):
        """"""
        self._insert(child, prepend=True, name=name)
        return self
1210353
def safe_wraps(wrapper, *args, **kwargs):
    """"""
    while isinstance(wrapper, functools.partial):
        wrapper = wrapper.func
    return functools.wraps(wrapper, *args, **kwargs)
1042994
def validate_wrap(self, value):
        ''' '''
        self._validate_wrap_type(value)
        self._length_valid(value)
        for v in value:
            self._validate_child_wrap(v)
588110
function wrap(input, wrap, ends) {

  if(!isString(input) || isUndefined(wrap)) {
    return input;
  }

  return [wrap, input, ends || wrap].join('');

}
860725
def _make_wrapper(f):
    """"""
    @wraps(f)
    def wrapper(*args, **kwargs):
        return f(*args, **kwargs)
    wrapper._pecan = f._pecan.copy()
    return wrapper
1064241
def p_parens_expr(p):
    
    p[0] = node.expr(op="parens", args=node.expr_list([p[2]]))
589753
def fold(self, predicate):
        """"""
        childs = {x:y.fold(predicate) for (x,y) in self._attributes.items()
                  if isinstance(y, SerializableTypedAttributesHolder)}
        return predicate(self, childs)
576
function wrap(fieldName, promise, args) {
  return promise(args).then((result) => ({
    [fieldName]: result,
  }));
}
1103383
function wrapTree(t) {
    var wt = {
      t: t,
      prelim: 0,
      mod: 0, 
      shift: 0, 
      change: 0,
      msel: 0,
      mser: 0,
    };
    t.x = 0;
    t.y = 0;
    if (size) {
      wt.x_size = 1;
      wt.y_size = 1;
    }
    else if (typeof nodeSize == "object") {  // fixed array
      wt.x_size = nodeSize[0];
      wt.y_size = nodeSize[1];
    }
    else {  // use nodeSize function
      var ns = nodeSize(t);
      wt.x_size = ns[0];
      wt.y_size = ns[1];
    }
    if (setNodeSizes) {
      t.x_size = wt.x_size;
      t.y_size = wt.y_size;
    }

    var children = [];
    var num_children = t.children ? t.children.length : 0;
    for (var i = 0; i < num_children; ++i) {
      children.push(wrapTree(t.children[i]));
    }
    wt.children = children;
    wt.num_children = num_children;

    return wt;
  }
639999
def match_paren(self, tokens, item):
        """"""
        match, = tokens
        return self.match(match, item)