Runtime helper for v-once.
Effectively it means marking the node as static with a unique key.
332582
function markOnce (
  tree,
  index,
  key
) {
  markStatic(tree, `__once__${index}${key ? `_${key}` : ``}`, true);
  return tree
}
601808
@CanIgnoreReturnValue
  private Node<K, V> addNode(@Nullable K key, @Nullable V value, @Nullable Node<K, V> nextSibling) {
    Node<K, V> node = new Node<K, V>(key, value);
    if (head == null) { // empty list
      head = tail = node;
      keyToKeyList.put(key, new KeyList<K, V>(node));
      modCount++;
    } else if (nextSibling == null) { // non-empty list, add to tail
      tail.next = node;
      node.previous = tail;
      tail = node;
      KeyList<K, V> keyList = keyToKeyList.get(key);
      if (keyList == null) {
        keyToKeyList.put(key, keyList = new KeyList<K, V>(node));
        modCount++;
      } else {
        keyList.count++;
        Node<K, V> keyTail = keyList.tail;
        keyTail.nextSibling = node;
        node.previousSibling = keyTail;
        keyList.tail = node;
      }
    } else { // non-empty list, insert before nextSibling
      KeyList<K, V> keyList = keyToKeyList.get(key);
      keyList.count++;
      node.previous = nextSibling.previous;
      node.previousSibling = nextSibling.previousSibling;
      node.next = nextSibling;
      node.nextSibling = nextSibling;
      if (nextSibling.previousSibling == null) { // nextSibling was key head
        keyToKeyList.get(key).head = node;
      } else {
        nextSibling.previousSibling.nextSibling = node;
      }
      if (nextSibling.previous == null) { // nextSibling was head
        head = node;
      } else {
        nextSibling.previous.next = node;
      }
      nextSibling.previous = node;
      nextSibling.previousSibling = node;
    }
    size++;
    return node;
  }
1049796
static <K,V> TreeMapEntry<K,V> predecessor(TreeMapEntry<K,V> t) {
        if (t == null)
            return null;
        else if (t.left != null) {
            TreeMapEntry<K,V> p = t.left;
            while (p.right != null)
                p = p.right;
            return p;
        } else {
            TreeMapEntry<K,V> p = t.parent;
            TreeMapEntry<K,V> ch = t;
            while (p != null && ch == p.left) {
                ch = p;
                p = p.parent;
            }
            return p;
        }
    }
566223
function callHook(vnode) {
		var original = vnode.state
		try {
			return this.apply(original, arguments)
		} finally {
			checkState(vnode, original)
		}
	}
20226
public static function __static()
	{
		// NameValue::$nameStartChar = "[:_\p{Ll}\p{Lu}\p{Lt}\p{Lo}\p{Nl}]";
		NameValue::$nameStartChar = SchemaTypes::$nameStartChar;
		NameValue::$nameChar = SchemaTypes::$nameChar;
		NameValue::$name = SchemaTypes::$name;
		NameValue::$ncName = SchemaTypes::$ncName;
	}
1272610
function markVariableAsUsed(context, name) {
  let scope = context.getScope();
  let variables;
  let i;
  let len;
  let found = false;

  // Special Node.js scope means we need to start one level deeper
  if (scope.type === 'global') {
    while (scope.childScopes.length) {
      scope = scope.childScopes[0];
    }
  }

  do {
    variables = scope.variables;
    for (i = 0, len = variables.length; i < len; i++) { // eslint-disable-line no-plusplus
      if (variables[i].name === name) {
        variables[i].eslintUsed = true;
        found = true;
      }
    }
    scope = scope.upper;
  } while (scope);

  return found;
}
884510
function findPrevNode(firstNode, item, comparer) {
    let ret;
    let prevNode = firstNode;
    // while item > prevNode.value
    while (prevNode != undefined && comparer(prevNode.value, item) > 0) {
        ret = prevNode;
        prevNode = prevNode.next;
    }
    return ret;
}
987822
function stringify(
	v
	, propertyMask	//# noPropertyMask!
	, limit
) {
	if ( v === undefined ) { return undefined ; }

	var runtime = {
		str: ''
		, depth: 0	//# noDepthTracking!
		, depthLimit: limit || depthLimit	//# noDepthLimit!
		, documentDepth: 0	//# noDocumentDepthLimit!
		, documentDepthLimit: limit || documentDepthLimit	//# noDocumentDepthLimit!
		, ancestors: []	//# noCircularRefNotation!
		, path: []		//# noUniqueRefNotation!
		, refs: new WeakMap()	//# noUniqueRefNotation!
	} ;

	stringifyAnyType(
		v
		, runtime
		, propertyMask	//# noPropertyMask!
	) ;

	return runtime.str ;
}
630675
@SuppressWarnings("unchecked")
    public org.w3c.dom.Node ensureExistence(final org.w3c.dom.Node contextNode) {
        final Document document = DOMHelper.getOwnerDocumentFor(contextNode);
        final Map<String, String> namespaceMapping = new HashMap<String, String>(userDefinedMapping);
        namespaceMapping.putAll(DOMHelper.getNamespaceMapping(document));
        //node.dump("");
        return ((List<org.w3c.dom.Node>) node.firstChildAccept(new BuildDocumentVisitor(variableResolver, namespaceMapping), contextNode)).get(0);
    }
1090037
function (value) {
        if (this.head === null) {
            return null;
        }

        var last = this.head._prev,
            node = last;

        if (node !== null) {
            if (value !== null) {
                do {
                    if (runtimeEquals(node._value, value)) {
                        return node;
                    }

                    node = node._prev;
                }
                while (node !== last);
            }
            else {
                do {
                    if (node._value === null) {
                        return node;
                    }

                    node = node._prev;
                }
                while (node !== last);
            }
        }

        return null;
    }
108088
@Override public JCTree visitVariable(VariableTree node, Void p) {
		JCVariableDecl original = node instanceof JCVariableDecl ? (JCVariableDecl) node : null;
		JCVariableDecl copy = (JCVariableDecl) super.visitVariable(node, p);
		if (original == null) return copy;
		copy.sym = original.sym;
		if (copy.sym != null) copy.type = original.type;
		if (copy.type != null) {
			boolean wipeSymAndType = copy.type.isErroneous();
			if (!wipeSymAndType) {
				TypeTag typeTag = TypeTag.typeTag(copy.type);
				wipeSymAndType = (CTC_NONE.equals(typeTag) || CTC_ERROR.equals(typeTag) || CTC_UNKNOWN.equals(typeTag) || CTC_UNDETVAR.equals(typeTag));
			}
			
			if (wipeSymAndType) {
				copy.sym = null;
				copy.type = null;
			}
		}
		
		return copy;
	}
107693
private static boolean inStaticContext(TreePath path) {
    Tree prev = path.getLeaf();
    path = path.getParentPath();

    ClassSymbol enclosingClass =
        ASTHelpers.getSymbol(ASTHelpers.findEnclosingNode(path, ClassTree.class));
    ClassSymbol directSuperClass = (ClassSymbol) enclosingClass.getSuperclass().tsym;

    for (Tree tree : path) {
      switch (tree.getKind()) {
        case METHOD:
          return ASTHelpers.getSymbol(tree).isStatic();
        case BLOCK: // static initializer
          if (((BlockTree) tree).isStatic()) {
            return true;
          }
          break;
        case VARIABLE: // variable initializer of static variable
          VariableTree variableTree = (VariableTree) tree;
          VarSymbol variableSym = ASTHelpers.getSymbol(variableTree);
          if (variableSym.getKind() == ElementKind.FIELD) {
            return Objects.equals(variableTree.getInitializer(), prev) && variableSym.isStatic();
          }
          break;
        case METHOD_INVOCATION: // JLS 8.8.7.1 explicit constructor invocation
          MethodSymbol methodSym = ASTHelpers.getSymbol((MethodInvocationTree) tree);
          if (methodSym == null) {
            // sometimes javac can't resolve the symbol. In this case just assume that we are
            // in a static context - this is a safe approximation in our context (checking
            // visibility)
            return true;
          }
          if (methodSym.isConstructor()
              && (Objects.equals(methodSym.owner, enclosingClass)
                  || Objects.equals(methodSym.owner, directSuperClass))) {
            return true;
          }
          break;
        default:
          break;
      }
      prev = tree;
    }
    return false;
  }
1103425
static <K, V> K keyOrNull(final OMVRBTreeEntry<K, V> e) {
    return e == null ? null : e.getKey();
  }
1075148
public final int prev(int node) {
        final int left = left(node);
        if (left != NIL) {
            return last(left);
        } else {
            int parent = parent(node);
            while (parent != NIL && node == left(parent)) {
                node = parent;
                parent = parent(parent);
            }
            return parent;
        }
    }
1296847
def single(self):
        
        nodes = super(ZeroOrOne, self).all()
        if len(nodes) == 1:
            return nodes[0]
        if len(nodes) > 1:
            raise CardinalityViolation(self, len(nodes))
17287
static <K> K key(TreeMapEntry<K,?> e) {
        if (e==null)
            throw new NoSuchElementException();
        return e.key;
    }
51755
def run_once(binding)
      @ivars.clear
      before = binding.instance_variables
      binding.instance_eval(&@block)
      (binding.instance_variables - before).each do |ivar|
        @ivars[ivar] = binding.instance_variable_get(ivar)
      end
    end