Write the Tree to a random Key homed here.
764598
public Key toKey() {
    AutoBuffer bs = new AutoBuffer();
    bs.put4(_data_id);
    bs.put8(_seed);
    bs.put1(_producerId);
    _tree.write(bs);
    Key key = Key.make((byte)1,Key.DFJ_INTERNAL_USER, H2O.SELF);
    DKV.put(key,new Value(key, bs.buf()));
    return key;
  }
205960
def _transform_key(self, masterkey):
        """"""

        aes = AES.new(self._transf_randomseed, AES.MODE_ECB)

        # Encrypt the created hash
        for _ in range(self._key_transf_rounds):
            masterkey = aes.encrypt(masterkey)

        # Finally, hash it again...
        sha_obj = SHA256.new()
        sha_obj.update(masterkey)
        masterkey = sha_obj.digest()
        # ...and hash the result together with the randomseed
        sha_obj = SHA256.new()
        sha_obj.update(self._final_randomseed + masterkey)
        return sha_obj.digest()
243234
function put(key, value) {
	var sections = key.split("/");
	if (!sections.length) return this;
	var tree = this.tree;
	putValue(sections, tree, value, 0);
	return new Result(sections, value);
}
580500
def run_tree (tree, g, l):
    """"""
    runner= Ayrton (g=g, l=l)
    return runner.run_tree (tree, 'unknown_tree')
179604
def write(self, *args):
        """"""
        ConfigParser.write(self, *args)
        if self.keyring_available:
            for key, thing in self._unsaved.items():
                action = thing[0]
                value = thing[1]
                if action == 'set':
                    keyring.set_password(self.keyring_name, key, value)
                elif action == 'delete':
                    try:
                        keyring.delete_password(self.keyring_name, key)
                    except:
                        pass
        self._unsaved = {}
247749
private RedBlackTreeNode<Key, Value> put(RedBlackTreeNode<Key, Value> h, Key key, Value value) {
	if (h == null)
	    return new RedBlackTreeNode<>(key, value, RED, 1);

	int cmp = key.compareTo(h.getKey());
	if (cmp < 0)
	    h.setLeft(put(h.getLeft(), key, value));
	else if (cmp > 0)
	    h.setRight(put(h.getRight(), key, value));
	else
	    h.setValue(value);

	// fix-up any right-leaning links
	if (isRed(h.getRight()) && !isRed(h.getLeft()))
	    h = rotateLeft(h);
	if (isRed(h.getLeft()) && isRed(h.getLeft().getLeft()))
	    h = rotateRight(h);
	if (isRed(h.getLeft()) && isRed(h.getRight()))
	    flipColors(h);
	h.setSize(size(h.getLeft()) + size(h.getRight()) + 1);

	return h;
    }
1256039
private static String generateKey(int num) {
        Random random = new Random();
        String key = "";

        for (int x = 0; x < num; x++) {
            key += CHARACTERS[random.nextInt(CHARACTERS.length)];
        }
        return key;
    }
608579
def _write_tree(self, tree: dict, output: Union[str, BinaryIO], file_mode: int=0o666) -> None:
        
        self.meta["created_at"] = get_datetime_now()
        meta = self.meta.copy()
        meta["environment"] = collect_environment()
        final_tree = {}
        final_tree.update(tree)
        final_tree["meta"] = meta
        isfileobj = not isinstance(output, str)
        if not isfileobj:
            self._source = output
            path = output
            output = open(output, "wb")
            os.chmod(path, file_mode)
            pos = 0
        else:
            pos = output.tell()
        try:
            with asdf.AsdfFile(final_tree) as file:
                queue = [("", tree)]
                while queue:
                    path, element = queue.pop()
                    if isinstance(element, dict):
                        for key, val in element.items():
                            queue.append((path + "/" + key, val))
                    elif isinstance(element, (list, tuple)):
                        for child in element:
                            queue.append((path, child))
                    elif isinstance(element, numpy.ndarray):
                        path += "/"
                        if path not in self._compression_prefixes:
                            self._log.debug("%s -> %s compression", path, self.ARRAY_COMPRESSION)
                            file.set_array_compression(element, self.ARRAY_COMPRESSION)
                        else:
                            self._log.debug("%s -> compression disabled", path)
                file.write_to(output)
            self._size = output.seek(0, os.SEEK_END) - pos
        finally:
            if not isfileobj:
                output.close()
1228130
def write_tree_newick(self, filename, hide_rooted_prefix=False):
        '''
        '''
        if not isinstance(filename, str):
            raise TypeError("filename must be a str")
        treestr = self.newick()
        if hide_rooted_prefix:
            if treestr.startswith('[&R]'):
                treestr = treestr[4:].strip()
            else:
                warn("Specified hide_rooted_prefix, but tree was not rooted")
        if filename.lower().endswith('.gz'): # gzipped file
            f = gopen(expanduser(filename),'wb',9); f.write(treestr.encode()); f.close()
        else: # plain-text file
            f = open(expanduser(filename),'w'); f.write(treestr); f.close()
138772
static function createKeys()
    {
        shuffle(static::$base);
        shuffle(static::$extra_base);
        return file_put_contents(_CONFIG.'keys/can.key', implode(static::$base)."\n".implode(static::$extra_base));
    }
822628
function mixkey(seed, key, smear, j) {
  seed += '';                         // Ensure the seed is a string
  smear = 0;
  for (j = 0; j < seed.length; j++) {
    key[lowbits(j)] =
      lowbits((smear ^= key[lowbits(j)] * 19) + seed.charCodeAt(j));
  }
  seed = '';
  for (j in key) { seed += String.fromCharCode(key[j]); }
  return seed;
}
227386
def insert(key, value)
      node = myself

      # Traverse the tree to find the right node to add or replace the value.
      while node do
        # All nodes that we find on the way that are full will be split into
        # two half-full nodes.
        if node.keys.size >= @tree.node_size
          node = node.split_node
        end

        # Once we have reached a leaf node we can insert or replace the value.
        if node.is_leaf?
          return node.insert_element(key, value)
        else
          # Descend into the right child node to add the value to.
          node = node.children[node.search_key_index(key)]
        end
      end

      PEROBS.log.fatal "Could not find proper node to insert into"
    end
1053799
private void writes() {
    int index = random.nextInt();
    for (;;) {
      Integer key = ints[index++ & MASK];
      cache.put(key, Boolean.TRUE);
      calls.increment();
    }
  }
777991
def gen_key(self, *values):
        """"""
        key = md5()
        KeyGen._recursive_convert(values, key)
        return key.hexdigest()
756480
public static void putKey(Writer writer, String key) throws IOException {
		writer.write("\"");
		writer.write(sanitize(key));
		writer.write("\":");
	}
921690
def put(self, key, value, append=False):
        
        self._put(ConfigTree.parse_key(key), value, append)
129560
def put(self, key, value):
    '''
    '''
    super(DirectoryTreeDatastore, self).put(key, value)

    str_key = str(key)

    # ignore root
    if str_key == '/':
      return

    # retrieve directory, to add entry
    dir_key = key.parent.instance('directory')
    directory = self.directory(dir_key)

    # ensure key is in directory
    if str_key not in directory:
      directory.append(str_key)
      super(DirectoryTreeDatastore, self).put(dir_key, directory)