Sets and returns new data for the specified node.
504693
def set(self, path, value):
        """"""
        _log.debug(
            "ZK: Setting {path} to {value}".format(path=path, value=value)
        )
        return self.zk.set(path, value)
51576
def new_node(self):
        """"""
        node_id = self.generate_node_id()

        node = {'id': node_id,
                'edges': [],
                'data': {}
        }

        self.nodes[node_id] = node

        self._num_nodes += 1

        return node_id
167479
public function execute(NodeData $node)
    {
        $currentPropertyValue = $node->getProperty($this->propertyName);
        $newPropertyValue = strtolower($currentPropertyValue);
        $node->setProperty($this->propertyName, $newPropertyValue);
    }
751295
def __inner_set_default(self, key, value):
        
        path = self.__path_of(key)

        try:
            # Try to get and return the existing node with its data
            value, _ = self.connection.retry(self.connection.get, path)
            return self.encoding.decode(value)
        except self.no_node_error:
            # Node does not exist, we have to create it
            self.connection.retry(self.connection.create, path, self.encoding.encode(value))
            self.__increment_last_updated()
            return value
487095
def from_node(cls, node):
        """"""
        kwargs = dict(
            node_id=node.node_id,
            node_finalized=node.finalized,
            node_history=list(node.history),
            node_name=node.name,
            node_class=node.__class__.__name__,
            node_status=str(node.status),
        )

        return node.Results(node, **kwargs)
68044
def _load_data(self, data, from_db=False):
        
        self._data = data[:]
        self.setattrs(
            values=[],
            node_stack=[],
            node_dict={},
        )
        self._from_db = from_db
1102131
private void fillNode(final ResourceXMLParser.Entity entity, final NodeEntryImpl node) {
        node.setUsername(entity.getProperty(NODE_USERNAME));
        node.setHostname(entity.getProperty(NODE_HOSTNAME));
        node.setOsArch(entity.getProperty(NODE_OS_ARCH));
        node.setOsFamily(entity.getProperty(NODE_OS_FAMILY));
        node.setOsName(entity.getProperty(NODE_OS_NAME));
        node.setOsVersion(entity.getProperty(NODE_OS_VERSION));
        node.setDescription(entity.getProperty(COMMON_DESCRIPTION));
        final String tags = entity.getProperty(COMMON_TAGS);
        final HashSet<String> tags1;
        if (null != tags && !"".equals(tags)) {
            tags1 = new HashSet<String>();
            for (final String s : tags.split(",")) {
                tags1.add(s.trim());
            }
        } else {
            tags1 = new HashSet<String>();
        }
        node.setTags(tags1);

        if (null == node.getAttributes()) {
            node.setAttributes(new HashMap<String, String>());
        }
        if (null != entity.getProperties()) {
            for (String key : entity.getProperties().stringPropertyNames()) {
                if (!ResourceXMLConstants.allPropSet.contains(key)) {
                    node.getAttributes().put(key, entity.getProperty(key));
                }
            }

        }
        //parse embedded attribute elements
    }
702521
def _node_set(self) -> List["InstanceNode"]:
        """"""
        return list(self) if isinstance(self.value, ArrayValue) else [self]
615002
public void update(int node) {
        final int prev = prev(node);
        final int next = next(node);
        if ((prev == NIL || compare(prev) > 0) && (next == NIL || compare(next) < 0)) {
            // Update can be done in-place
            copy(node);
            for (int n = node; n != NIL; n = parent(n)) {
                fixAggregates(n);
            }
        } else {
            // TODO: it should be possible to find the new node position without
            // starting from scratch
            remove(node);
            add();
        }
    }
1178539
def update_node(self, node, diff=None):
        """"""
        lb = node.parent
        if not lb:
            raise exc.UnattachedNode("No parent Load Balancer for this node "
                    "could be determined.")
        if diff is None:
            diff = node._diff()
        req_body = {"node": diff}
        resp, body = self.api.method_put("/loadbalancers/%s/nodes/%s" %
                (lb.id, node.id), body=req_body)
        return resp, body
651661
def new_data(self, mem, addr, data):
        """"""
        if mem.id == self.id:
            if addr == 0:
                if self._parse_and_check_header(data[0:8]):
                    if self._parse_and_check_elements(data[9:11]):
                        self.valid = True
                        self._update_finished_cb(self)
                        self._update_finished_cb = None
                    else:
                        # We need to fetch the elements, find out the length
                        (elem_ver, elem_len) = struct.unpack('BB', data[8:10])
                        self.mem_handler.read(self, 8, elem_len + 3)
                else:
                    # Call the update if the CRC check of the header fails,
                    # we're done here
                    if self._update_finished_cb:
                        self._update_finished_cb(self)
                        self._update_finished_cb = None
            elif addr == 0x08:
                if self._parse_and_check_elements(data):
                    self.valid = True
                if self._update_finished_cb:
                    self._update_finished_cb(self)
                    self._update_finished_cb = None
864294
def node_copy(node, nodefactory=Node):
    """"""
    return nodefactory(node.tag, node.attrib.copy(), node.text,
                       [node_copy(n, nodefactory) for n in node])
500285
def newDocRawNode(self, ns, name, content):
        
        if ns is None: ns__o = None
        else: ns__o = ns._o
        ret = libxml2mod.xmlNewDocRawNode(self._o, ns__o, name, content)
        if ret is None:raise treeError('xmlNewDocRawNode() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp
302818
function(node) {
			var newNode = node.cloneNode(true);
			if(this.hasAttribute(node, 'id')){
				this.removeAttribute(node, 'id')
			}
			return newNode;
		}
751776
def replace(self, new_node):
        """"""
        cur_node = self.cur_node
        nodestack = self.nodestack
        cur = nodestack.pop()
        prev = nodestack[-1]
        index = prev[-1] - 1
        oldnode, name = prev[-2][index]
        assert cur[0] is cur_node is oldnode, (cur[0], cur_node, prev[-2],
                                               index)
        parent = prev[0]
        if isinstance(parent, list):
            parent[index] = new_node
        else:
            setattr(parent, name, new_node)
1033469
def new(self, data):
        
        temp = copy(self)
        temp.__init__(data)
        return temp
68683
def add(self, node):
        """"""
        if not isinstance(node, Node):
            raise TypeError()
        for i, j in enumerate(self.__nodes):
            if j.node_id == node.node_id:
                self.__nodes[i] = node
                return
        self.__nodes.append(node)