Removes unncessary parens for each argument in a function node. Returns a node.
555936
function removeUnnecessaryParensInFunctionNode(node) {
  node.args.forEach((child, i) => {
    if (Node.Type.isParenthesis(child)) {
      child = child.content;
    }
    node.args[i] = removeUnnecessaryParensSearch(child);
  });

  return node;
}
1629
function _cleanNodes (nodes) {
  nodes.forEach(function (tag) {
    // avoiding circular structure
    delete tag._parent;

    // removing temporary tester
    delete tag.match_closer;

    // cleaning empty attributes
    if( tag.attrs && Object.keys(tag.attrs).length === 0 ) delete tag.attrs;

    // cleaning empty children
    if( tag._ instanceof Array ) {
      if( !tag._.length ) delete tag._;
      else _cleanNodes(tag._);
    }

  });
  return nodes;
}
53366
def remove_isolated_nodes(G):
    

    isolated_nodes = [node for node, degree in dict(G.degree()).items() if degree < 1]
    G.remove_nodes_from(isolated_nodes)
    log('Removed {:,} isolated nodes'.format(len(isolated_nodes)))
    return G
1144207
def remove_irrelevant_nodes(frame, options, total_time=None):
    '''
    
    '''
    if frame is None:
        return None
    
    if total_time is None:
        total_time = frame.time()

    filter_threshold = options.get('filter_threshold', 0.01)

    for child in frame.children:
        proportion_of_total = child.time() / total_time

        if proportion_of_total < filter_threshold:
            frame.self_time += child.time()
            child.remove_from_parent()
        
    for child in frame.children:
        remove_irrelevant_nodes(child, options=options, total_time=total_time)

    return frame
609307
function removeDuplicates() {
    var args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
    }
    if (chek_1.isArray(args[0]))
        args = args[0];
    return args.filter(function (el, i) {
        return args.indexOf(el) === i;
    });
}
186719
def prune_unrepresented(self):
        
        for node in self.depth_first_iter(self_first=False):
            if (not node.children and
                    not node.sequence_ids and
                    node is not self):
                node.parent.remove_child(node)
630878
function validateNode(node) {
            const parens = getParenTokens(node);

            if (parens) {
                validateParens(parens, astUtils.isFunction(node) ? node.params : node.arguments);

                if (multilineArgumentsOption) {
                    validateArguments(parens, astUtils.isFunction(node) ? node.params : node.arguments);
                }
            }
        }
245651
def removable(self, node):
    '''
    
    '''
    throw_away = []
    for child in self.children(node):
        throw_away.append(self.visit(child))

    if self.mode == 'exclusive':
        return all(throw_away)
    elif self.mode == 'inclusive':
        return any(throw_away)
    else:
        raise TypeError("mode must be one of 'exclusive' or 'inclusive'")
529644
function removeExponentByOne(node) {
  if (node.op === '^' &&                   // exponent of anything
      Node.Type.isConstant(node.args[1]) && // to a constant
      node.args[1].value === '1') {        // of value 1
    const newNode = clone(node.args[0]);
    return Node.Status.nodeChanged(
      ChangeTypes.REMOVE_EXPONENT_BY_ONE, node, newNode);
  }
  return Node.Status.noChange(node);
}
851867
function simplify(node, debug=false) {
  if(checks.hasUnsupportedNodes(node)) {
    return node;
  }

  const steps = stepThrough(node, debug);
  let simplifiedNode;
  if (steps.length > 0) {
    simplifiedNode = steps.pop().newNode;
  }
  else {
    // removing parens isn't counted as a step, so try it here
    simplifiedNode = removeUnnecessaryParens(flattenOperands(node), true);
  }
  // unflatten the node.
  return unflatten(simplifiedNode);
}
759669
function removeMultiplicationByOne(node) {
  if (node.op !== '*') {
    return Node.Status.noChange(node);
  }
  const oneIndex = node.args.findIndex(arg => {
    return Node.Type.isConstant(arg) && arg.value === '1';
  });
  if (oneIndex >= 0) {
    let newNode = clone(node);
    // remove the 1 node
    newNode.args.splice(oneIndex, 1);
    // if there's only one operand left, there's nothing left to multiply it
    // to, so move it up the tree
    if (newNode.args.length === 1) {
      newNode = newNode.args[0];
    }
    return Node.Status.nodeChanged(
      ChangeTypes.REMOVE_MULTIPLYING_BY_ONE, node, newNode);
  }
  return Node.Status.noChange(node);
}
740474
def p_arg1(p):
    
    # a hack to support "clear global"
    p[0] = node.string(value=str(p[1]), lineno=p.lineno(1), lexpos=p.lexpos(1))
1108724
function removeUnusedVariableDeclarators (ast) {
  var unused = findUnusedVariableDeclarators(ast);
  traverse.traverse(ast, {
    enter: function (node, parent) {
      if (node.type !== 'VariableDeclaration') {
        return;
      }
      node.declarations = fast.filter(node.declarations, function (item) {
        return !~fast.indexOf(unused, item);
      });
    }
  });
  return ast;
}
1354689
def remove(self, *args):
        
        for x in args:
            self.children.remove(x)
        return self.children
1080123
function unwrapElements(parent, wrapper) {
  var el = wrapper.childNodes[0];

  // ok, so this looks weird, right?
  // turns out, appending nodes to another node will remove them
  // from the live NodeList, so we can keep iterating over the
  // first item in that list and grab all of them. Nice!
  while (el) {
    parent.appendChild(el);
    el = wrapper.childNodes[0];
  }

  parent.removeChild(wrapper);
}
455115
function clear(node){
    node = get(node);

    while (node[LAST_CHILD])
      node.removeChild(node[LAST_CHILD]);

    return node;
  }
560009
function ( obj, fn ) {
		var remove;

		if ( typeof fn !== "function" ) {
			throw new Error( label.error.invalidArguments );
		}

		remove = obj.filter( fn );

		array.each( remove, function ( i ) {
			array.remove( obj, array.index ( obj, i ) );
		});

		return obj;
	}