Sets the data of a node at the given path, or creates it.
2139
def set_or_create(self, path, *args, **kwargs):
        """"""

        d = self.set(path, *args, **kwargs)

        @d.addErrback
        def _error(result):
            return self.create(path, *args, **kwargs)

        return d
186686
public void setData(final String path, byte data[], int version,
            StatCallback cb, Object ctx) {
        verbotenThreadCheck();
        final String clientPath = path;
        PathUtils.validatePath(clientPath);

        final String serverPath = prependChroot(clientPath);

        RequestHeader h = new RequestHeader();
        h.setType(ZooDefs.OpCode.setData);
        SetDataRequest request = new SetDataRequest();
        request.setPath(serverPath);
        request.setData(data);
        request.setVersion(version);
        SetDataResponse response = new SetDataResponse();
        cnxn.queuePacket(h, new ReplyHeader(), request, response, cb,
                clientPath, serverPath, ctx, null);
    }
539965
function create_node_by_path(context, path, len, tracker) {
	let node = context.state.rootNode;
	for (let i = 0; i < len; i++) {
		const k = path[i];
		if (k == "_") continue;
		if (k == "#") {
			node = context.state.rootNode;
			continue;
		}
		if (node_type(node[k]) != NodeTypes.NODE) {
			commit_node_prop(context, node, k, create_node(), tracker);
		}
		node = node[k];
	}
	return node;
}
716085
function setValue (root, path, value) {
  const tokens = tokenize(path)
  let node = root

  let i
  for (i = 0; i < tokens.length - 1; i++) {
    const token = tokens[i]

    if (node[token] !== undefined && typeof node[token] === 'object') {
      node = node[token]
    } else if (typeof tokens[i + 1] === 'number') {
      node = node[token] = []
    } else {
      node = node[token] = {}
    }
  }

  node[tokens[i]] = value
}
1085125
def set_attr(obj, path, value):
    
    try:
        return _set_attr(obj, split_field(path), value)
    except Exception as e:
        Log = get_logger()
        if PATH_NOT_FOUND in e:
            Log.warning(PATH_NOT_FOUND + ": {{path}}", path=path, cause=e)
        else:
            Log.error("Problem setting value", cause=e)
370843
function _set(obj, path, value) {
  var subpathes = path.split('.');
  while (subpathes.length - 1) {
    obj = obj[subpathes.shift()];
  }
  obj[subpathes.shift()] = value;
}
504693
def set(self, path, value):
        """"""
        _log.debug(
            "ZK: Setting {path} to {value}".format(path=path, value=value)
        )
        return self.zk.set(path, value)
423404
public boolean createNode(String path, String value) throws ZooKeeperException {
        return _create(path, value != null ? value.getBytes(UTF8) : null, CreateMode.PERSISTENT);
    }
1217360
def set(self, path, data):
        
        return self._zk.set(self.__path(path), data)
1226968
def put(self, path, data, **options):
        """"""
        parameter_options = self._parse_parameter_options(options)
        body = {
            # values in the data body takes precendence
            'data': _merge(parameter_options, data),
            'options': self._parse_api_options(options)
        }
        headers = _merge(
            {'content-type': 'application/json'},
            options.pop('headers', {})
        )
        return self.request('put', path, data=body, headers=headers, **options)
241312
public void setPath(int pathId, String path) {
        PreparedStatement statement = null;
        try (Connection sqlConnection = sqlService.getConnection()) {
            statement = sqlConnection.prepareStatement(
                "UPDATE " + Constants.DB_TABLE_PATH +
                    " SET " + Constants.PATH_PROFILE_ACTUAL_PATH + " = ? " +
                    " WHERE " + Constants.GENERIC_ID + " = ?"
            );
            statement.setString(1, path);
            statement.setInt(2, pathId);
            statement.executeUpdate();
            statement.close();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try {
                if (statement != null) {
                    statement.close();
                }
            } catch (Exception e) {
            }
        }
    }
855462
def set(self, uri, content, **meta):
        
        try:
            node = self._update(uri, content, **meta)
            created = False
        except NodeDoesNotExist:
            node = self._create(uri, content, **meta)
            created = True
        return self._serialize(uri, node), created
953666
def set(self, uri, content):
        
        key, value = self._prepare_node(uri, content)
        self._set(key, value)
320329
public void setValue(List<P> path, V value) {

        ensureNode(path).setValue(value);

    }
566813
private void setPathInfo(String path) {

        m_infoPath.setValue(path);

        // generate the path bread crumb
        m_crumbs.removeAllComponents();
        int i = path.indexOf("/");
        String openPath = "";
        while (i >= 0) {
            String fragment = path.substring(0, i + 1);
            openPath += fragment;
            path = path.substring(i + 1);
            i = path.indexOf("/");
            Button crumb = new Button(fragment, m_crumbListener);
            crumb.setData(openPath);
            crumb.addStyleName(ValoTheme.BUTTON_LINK);
            m_crumbs.addComponent(crumb);
        }
    }
1116502
public function setNodeContent($path, $value)
    {
        $node = $this->getNode($path);
        if ($node) {
            while ($node->hasChildNodes()) {
                $node->removeChild($node->firstChild);
            }
            $node->appendChild($this->domDocument->createTextNode($value));
        }
    }
933487
public boolean setData(String path, String value) throws ZooKeeperException {
        return setData(path, value, false);
    }