Add a datum into the BK-tree.
517706
public void add(E datum) {
        if (root == null) {
            root = new Node(count++, datum);
        } else {
            root.add(datum);
        }
    }
222671
def cumulate(self, axis):
        """"""
        axis = self.get_axis_number(axis)
        return Histdd.from_histogram(np.cumsum(self.histogram, axis=axis),
                                     bin_edges=self.bin_edges,
                                     axis_names=self.axis_names)
268797
def add(self, value):
        """"""
        path = value if isinstance(value, Path) else Path(str(value))
        if path and path != path.parent:
            destination = self
            for part in path.parts:
                destination = destination.setdefault(part, DirectoryTree())
977677
def add_data_point(self, x, y):
        """"""

        if not is_numeric(x):
            raise TypeError("x value must be numeric, not '%s'" % str(x))
        if not is_numeric(y):
            raise TypeError("y value must be numeric, not '%s'" % str(y))
        current_last_x = self._data[-1][0]
        self._data.append((x, y))
        if x < current_last_x:
            self._data = sorted(self._data, key=lambda k: k[0])
50237
def set_add(parent, idx, value):
  """"""
  lst = get_child(parent, idx)
  if value not in lst:
    lst.append(value)
26592
def __insert_branch(u, v, dfs_data):
    """"""
    w = L1(v, dfs_data)
    d_u = D(u, dfs_data)
    d_w = D(w, dfs_data)

    # Embed uw
    successful = __embed_frond(u, w, dfs_data)
    if not successful:
        return False

    # Embed a branch marker uu on the side opposite to uw, in the same frond block
    #successful = __embed_frond(u, v, dfs_data, as_branch_marker=True)
    successful = __embed_frond(u, u, dfs_data, as_branch_marker=True)
    if not successful:
        return False

    return True
45155
public void addAll(Iterable<? extends Datum<L,F>> data) {
    for (Datum<L, F> d : data) {
      add(d);
    }
  }
86859
def _add_to_tree(tree, word, meaning):
    '''
    
    '''
    if len(word) == 0:
        tree[''] = meaning
    else:
        _add_to_tree(tree[word[0]], word[1:], meaning)
729752
def map_tree(visitor, tree):
    """"""
    newn = [map_tree(visitor, node) for node in tree.nodes]
    return visitor(tree, newn)
528830
def insert(self, value):
        """"""
        i = 0
        n = len(self._tree)
        while i < n:
            cur = self._tree[i]
            self._counts[i] += 1
            if value < cur:
                i = 2 * i + 1
            elif value > cur:
                i = 2 * i + 2
            else:
                return
        raise ValueError("Value %s not contained in tree." "Also, the counts are now messed up." % value)
394436
public void update(final long datum) {
    final long[] data = { datum };
    final long[] arr = hash(data, seed);
    hashUpdate(arr[0], arr[1]);
  }
450013
@Override
    public Datum<int[]> add(Datum<int[]> datum) {
        int[] x = datum.x;
        
        for (int xi : x) {
            if (xi < 0) {
                throw new IllegalArgumentException("Negative index of nonzero element: " + xi);
            }
        }
        
        Arrays.sort(x);
        for (int i = 1; i < x.length; i++) {
            if (x[i] == x[i-1]) {
                throw new IllegalArgumentException("Duplicated indices of nonzero elements: " + x[i]);
            }
        }
        
        n += x.length;
        
        int max = Math.max(x);
        if (numColumns <= max) {
            numColumns = max + 1;
            if (numColumns > colSize.length) {
                int[] size = new int[3 * numColumns / 2];
                System.arraycopy(colSize, 0, size, 0, colSize.length);
                colSize = size;
            }
        }
        
        for (int xi : x) {
            colSize[xi]++;
        }
        
        return super.add(datum);
    }
339781
def assoc(self, index, value):
        ''''''
        newnode = LookupTreeNode(index, value)
        newtree = LookupTree()
        newtree.root = _assoc_down(self.root, newnode, 0)
        return newtree
320124
def _dendropy_to_dataframe(
    tree,
    add_node_labels=True,
    use_uids=True):
    """"""
    # Maximum distance from root.
    tree.max_distance_from_root()

    # Initialize the data object.
    idx = []
    data = {
        'type': [],
        'id': [],
        'parent': [],
        'length': [],
        'label': [],
        'distance': []}

    if use_uids:
        data['uid'] = []

    # Add labels to internal nodes if set to true.
    if add_node_labels:
        for i, node in enumerate(tree.internal_nodes()):
            node.label = str(i)

    for node in tree.nodes():
        # Get node type
        if node.is_leaf():
            type_ = 'leaf'
            label = str(node.taxon.label).replace(' ', '_')
        elif node.is_internal():
            type_ = 'node'
            label = str(node.label)

        # Set node label and parent.
        id_ = label
        parent_node = node.parent_node
        length = node.edge_length
        distance = node.distance_from_root()

        # Is this node a root?
        if parent_node is None and length is None:
            parent_label = None
            parent_node = None
            length = 0
            distance = 0
            type_ = 'root'

        # Set parent node label
        elif parent_node.is_internal():
            parent_label = str(parent_node.label)

        else:
            raise Exception("Subtree is not attached to tree?")

        # Add this node to the data.
        data['type'].append(type_)
        data['id'].append(id_)
        data['parent'].append(parent_label)
        data['length'].append(length)
        data['label'].append(label)
        data['distance'].append(distance)

        if use_uids:
            data['uid'].append(get_random_id(10))

    # Construct dataframe.
    df = pandas.DataFrame(data)
    return df
676671
def add_node(self, node, weight=1):
        """"""
        self._nodes.add(node)
        self._weights[node] = weight
        self._rebuild_circle()
582660
def add(self, labels, value):
        """"""

        if type(value) not in (float, int):
            raise TypeError("Summary only works with digits (int, float)")

        # We have already a lock for data but not for the estimator
        with mutex:
            try:
                e = self.get_value(labels)
            except KeyError:
                # Initialize quantile estimator
                e = quantile.Estimator(*self.__class__.DEFAULT_INVARIANTS)
                self.set_value(labels, e)
            e.observe(float(value))
286647
def insert(self, value):
        """"""
        if not self.payload or value == self.payload:
            self.payload = value
        else:
            if value <= self.payload:
                if self.left:
                    self.left.insert(value)
                else:
                    self.left = BinaryTreeNode(value)
            else:
                if self.right:
                    self.right.insert(value)
                else:
                    self.right = BinaryTreeNode(value)