Returns a new node holding item.  Uses relaxed write because item
can only be seen after piggy-backing publication via casNext.
518268
static <E> Node<E> newNode(E item) {
        Node<E> node = new Node<E>();
        U.putObject(node, ITEM, item);
        return node;
    }
985892
function insertNode(i, x, y, last) {
       var p = new Node(i, x, y);

       if (!last) {
           p.prev = p;
           p.next = p;

       } else {
           p.next = last.next;
           p.prev = last;
           last.next.prev = p;
           last.next = p;
       }
       return p;
   }
626462
function createWordNode (item) {
      var wordNode = parser.createParentNode('Word')

      if (options && options.pos) {
        wordNode.data = item
      }

      var textNode = parser.createTextNode('Text', item.surface_form)

      parser.add(textNode, wordNode)

      return wordNode
    }
1198404
function wrapChildrenInDefaultBlock(
    opts: Options,
    change: Change,
    node: Node
): Change {
    change.wrapBlockByKey(node.nodes.first().key, opts.typeDefault, {
        normalize: false
    });

    const wrapper = change.value.document.getDescendant(node.key).nodes.first();

    // Add in the remaining items
    node.nodes.rest().forEach((child, index) =>
        change.moveNodeByKey(child.key, wrapper.key, index + 1, {
            normalize: false
        })
    );

    return change;
}
824277
def newDocTextLen(self, content, len):
        
        ret = libxml2mod.xmlNewDocTextLen(self._o, content, len)
        if ret is None:raise treeError('xmlNewDocTextLen() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp
230486
public static String createParticipantNode(ZooKeeper zk, String dir, String prefix, byte[] data)
        throws KeeperException, InterruptedException
    {
        createRootIfNotExist(zk, dir);

        String node = zk.create(ZKUtil.joinZKPath(dir, prefix + "_"), data,
                                Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL);

        // Unlock the dir as initialized
        zk.setData(dir, new byte[] {INITIALIZED}, -1);

        return node;
    }
124488
def new_item(self, hash_key, range_key=None, attrs=None):
        
        return Item(self, hash_key, range_key, attrs)
508326
def update_property_node(node_to_insert, field_uri):
  
  root = T.SetItemField(
            T.FieldURI(FieldURI=field_uri),
            T.CalendarItem(node_to_insert)
        )
  return root
715419
def dnode(self, node):
        """"""
        new_node = copy(node)
        new_node.lineno += self.dline
        new_node.col_offset += self.dcol
        return new_node
991901
def get_item(self):
        ""

        if hasattr(self, 'get_draft'):
            draft = self.get_draft()
        else:
            draft = self

        if not hasattr(self, '_item_cache'):
            try:
                self._item_cache = draft.item.get_published_or_draft()
            except AttributeError:
                # not publishable
                self._item_cache = draft.item
        return self._item_cache
744329
def add(self, text, checked=False, sort=None):
        
        if self.parent is None:
            raise exception.InvalidException('Item has no parent')
        node = self.parent.add(text, checked, sort)
        self.indent(node)
        return node
627457
function moveAsSubItem(
    opts: Options,
    change: Change,
    // The list item to add
    item: Block,
    // The key of the destination node
    destKey: string
): Change {
    const destination = change.value.document.getDescendant(destKey);
    const lastIndex = destination.nodes.size;
    const lastChild = destination.nodes.last();

    // The potential existing last child list
    const existingList = isList(opts, lastChild) ? lastChild : null;

    if (existingList) {
        return change.moveNodeByKey(
            item.key,
            existingList.key,
            existingList.nodes.size // as last item
        );
    }
    const currentList = getListForItem(opts, change.value, destination);
    if (!currentList) {
        throw new Error('Destination is not in a list');
    }

    const newSublist = Block.create({
        object: 'block',
        type: currentList.type,
        data: currentList.data
    });

    change.insertNodeByKey(destKey, lastIndex, newSublist, {
        normalize: false
    });

    return change.moveNodeByKey(item.key, newSublist.key, 0);
}
139786
def createItem( self ):
        
        if not self.isEditable():
            return None
        
        if self._createItem is None:
            self.blockSignals(True)
            
            self._createItem = XMultiTagCreateItem(self)
            self.addItem(self._createItem)
            
            self.blockSignals(False)
        
        return self._createItem
695578
static Node newVarNode(Node lhs, Node value) {
    if (lhs.isDestructuringPattern()) {
      checkNotNull(value);
      return IR.var(new Node(Token.DESTRUCTURING_LHS, lhs, value).srcref(lhs)).srcref(lhs);
    } else {
      checkState(lhs.isName() && !lhs.hasChildren());
      if (value != null) {
        lhs.addChildToBack(value);
      }
      return IR.var(lhs).srcref(lhs);
    }
  }
255102
function createTextNode (type, item) {
      var node = parser.createTextNode(type, item.surface_form)

      if (options && options.pos) {
        node.data = item
      }

      return node
    }
1343820
def _get_node(self, treelist, pos):
        
        node = None
        if pos is not None:
            subtree = self._get_substructure(treelist, pos)
            if subtree is not None:
                node = subtree[0]
        return node
823313
function PersistInNode(n) {
        RED.nodes.createNode(this,n);
        var node = this;

        node.name = n.name;
        node.storageNode = RED.nodes.getNode(n.storageNode);

        node.on("input", function(msg) {
            node.storageNode.store(node.name, msg);
        });
    }