Drops a node from the tree:
the node's content is replaced by a single-line comment.
324217
function(node, desc) {
    node.content = ' ' + (desc || node.type);
    node.type = NodeType.COMMENT;
    return false;
  }
106784
function removeLineComments(content) {
  let newContent = '';
  let comment = false;
  for (let i = 0; i < content.length; i += 1) {
    const c = content[i];
    if (c === '#') {
      comment = true;
    }
    if (comment) {
      if (c === '\n') {
        comment = false;
      }
    }
    if (!comment) {
      newContent += c;
    }
  }
  return newContent;
}
562875
public void removeThing(BareJid thing)
                    throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        removeThing(thing, NodeInfo.EMPTY);
    }
455115
function clear(node){
    node = get(node);

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

    return node;
  }
1284000
def remove_comments(self, recursive=True):
        
        self.text = texutils.remove_comments(self.text)
        if recursive:
            for path, document in self._children.iteritems():
                document.remove_comments(recursive=True)
526638
def clean_document(node):
    """"""
    if node is None or len(node) == 0:
        return None

    logger.debug("\n\n-------------- CLEANING DOCUMENT -----------------")
    to_drop = []

    for n in node.iter():
        # clean out any in-line style properties
        if "style" in n.attrib:
            n.set("style", "")

        # remove embended objects unless it's wanted video
        if n.tag in ("object", "embed") and not ok_embedded_video(n):
            logger.debug("Dropping node %s %r", n.tag, n.attrib)
            to_drop.append(n)

        # clean headings with bad css or high link density
        if n.tag in ("h1", "h2", "h3", "h4") and get_class_weight(n) < 0:
            logger.debug("Dropping <%s>, it's insignificant", n.tag)
            to_drop.append(n)

        if n.tag in ("h3", "h4") and get_link_density(n) > 0.33:
            logger.debug("Dropping <%s>, it's insignificant", n.tag)
            to_drop.append(n)

        # drop block element without content and children
        if n.tag in ("div", "p"):
            text_content = shrink_text(n.text_content())
            if len(text_content) < 5 and not n.getchildren():
                logger.debug(
                    "Dropping %s %r without content.", n.tag, n.attrib)
                to_drop.append(n)

        # finally try out the conditional cleaning of the target node
        if clean_conditionally(n):
            to_drop.append(n)

    drop_nodes_with_parents(to_drop)

    return node
875720
function () {
					oNodeForContext.nodeState.removed = false;
					var iNodeStateFound = that._aRemoved.indexOf(oNodeForContext);
					if (iNodeStateFound != -1) {
						that._aRemoved.splice(iNodeStateFound, 1);
					}
					// clear cache to make sure findNode etc. don't deliver wrong nodes (index is shifted due to adding)
					this._aNodeCache = [];
					that._cleanTreeStateMaps();
					that._fireChange({reason: ChangeReason.Add});
				}
1130786
function(node, offset) {
			return node && node.type === 'comment' && offset >= node.range[0] && offset <= node.range[1];
		}
612653
public static void replaceDocTree(
      SuggestedFix.Builder fix, DocTreePath docPath, String replacement) {
    DocTree leaf = docPath.getLeaf();
    checkArgument(
        leaf instanceof DCTree.DCEndPosTree, "no end position information for %s", leaf.getKind());
    DCTree.DCEndPosTree<?> node = (DCTree.DCEndPosTree<?>) leaf;
    DCTree.DCDocComment comment = (DCTree.DCDocComment) docPath.getDocComment();
    fix.replace((int) node.getSourcePosition(comment), node.getEndPos(comment), replacement);
  }
747573
def del_node(self, node):
        
        for each in list(self.neighbors(node)):
            if (each != node):
                self.del_edge((each, node))
        del(self.node_neighbors[node])
        del(self.node_attr[node])
200818
async function ensureCommentRemoval(prNo, topic) {
  try {
    logger.debug(`Ensuring comment "${topic}" in #${prNo} is removed`);
    const comments = await getComments(prNo);
    let commentId;
    comments.forEach(comment => {
      if (comment.text.startsWith(`### ${topic}\n\n`)) {
        commentId = comment.id;
      }
    });
    if (commentId) {
      await deleteComment(prNo, commentId);
    }
  } catch (err) /* istanbul ignore next */ {
    logger.warn({ err }, 'Error ensuring comment removal');
  }
}
630334
def _get_stripped_text_from_node(self, node):
        """"""
        return (
            node.text_content()
            .replace(u"\u00A0", " ")
            .replace("\t", "")
            .replace("\n", "")
            .strip()
        )
227416
function clean(node, newObj) {
  [
    "loc",
    "range",
    "raw",
    "comments",
    "leadingComments",
    "trailingComments",
    "parenthesizedExpression",
    "parent",
    "prev",
    "start",
    "end",
    "tokens",
    "errors",
    "extra"
  ].forEach(name => {
    delete newObj[name];
  });

  if (node.kind === "string") {
    // TODO if options are available in this method, replace with
    // newObj.isDoubleQuote = !util.useSingleQuote(node, options);
    delete newObj.isDoubleQuote;
  }

  if (node.kind === "inline") {
    if (node.value.includes("___PSEUDO_INLINE_PLACEHOLDER___")) {
      return null;
    }

    newObj.value = newObj.value.replace(/\r\n?|\n/g, "");
  }

  // continue ((2)); -> continue 2;
  // continue 1; -> continue;
  if ((node.kind === "continue" || node.kind === "break") && node.level) {
    const { level } = newObj;

    if (level.kind === "number") {
      newObj.level = level.value === "1" ? null : level;
    }
  }

  // if () {{ }} -> if () {}
  if (node.kind === "block") {
    if (node.children.length === 1 && node.children[0].kind === "block") {
      while (newObj.children[0].kind === "block") {
        newObj.children = newObj.children[0].children;
      }
    }
  }

  // Normalize numbers
  if (node.kind === "number") {
    newObj.value = util.printNumber(node.value);
  }

  const statements = ["foreach", "for", "if", "while", "do"];

  if (statements.includes(node.kind)) {
    if (node.body && node.body.kind !== "block") {
      newObj.body = {
        kind: "block",
        children: [newObj.body]
      };
    } else {
      newObj.body = newObj.body ? newObj.body : null;
    }

    if (node.alternate && node.alternate.kind !== "block") {
      newObj.alternate = {
        kind: "block",
        children: [newObj.alternate]
      };
    } else {
      newObj.alternate = newObj.alternate ? newObj.alternate : null;
    }
  }

  if (node.kind === "usegroup" && typeof node.name === "string") {
    newObj.name = newObj.name.replace(/^\\/, "");
  }

  if (node.kind === "useitem") {
    newObj.name = newObj.name.replace(/^\\/, "");
  }

  if (node.kind === "method" && node.name.kind === "identifier") {
    newObj.name.name = util.normalizeMagicMethodName(newObj.name.name);
  }

  // @TODO: We need special node for `null` value to avoid ast compare problem
  if (node.kind === "classreference" && node.name.toLowerCase() === "null") {
    delete newObj.name;
  }
}
556591
function stripComments(token) {
  return strip

  /* Strip comments. */
  function strip(value) {
    var index = value.indexOf(token)

    if (index !== -1) {
      value = value.substr(0, index)
    }

    return value
  }
}
1162998
function stripTrailingComment(line, comment) {

            // loc.column is zero-indexed
            return line.slice(0, comment.loc.start.column).replace(/\s+$/u, "");
        }
112731
function removeNode(node) {
    //确保执行一次+内存回收
    node.onload = node.onerror = node.onreadystatechange = null;
    if (node.parentNode) {
        setTimeout(function() {
            node.parentNode.removeChild(node);
            node = null;
        }, 0);
    }
}
547099
def pop(self):
        
        node = self.nodes.pop()
        self.__keys.remove(node.key)