Returns a copy of d with compressed leaves.
805
def compress(self, d=DEFAULT):
        """"""
        if d is DEFAULT:
            d = self
        if isinstance(d, list):
            l = [v for v in (self.compress(v) for v in d)]
            try:
                return list(set(l))
            except TypeError:
                # list contains not hashables
                ret = []
                for i in l:
                    if i not in ret:
                        ret.append(i)
                return ret
        elif isinstance(d, type(self)):
            return type(self)({k: v for k, v in ((k, self.compress(v)) for k, v in d.items())})
        elif isinstance(d, dict):
            return {k: v for k, v in ((k, self.compress(v)) for k, v in d.items())}
        return d
1357518
function copy(product, left) {
  product.rows = parseInt(left.rows);
  product.columns = parseInt(left.columns);
  product.weights = left.weights.slice(0);
  product.deltas = left.deltas.slice(0);
}
753944
def copy(self):
        """"""
        result = self.space.element()
        result.assign(self)
        return result
640690
function (from, to) {
            var toFile = xpfile(to);
            return xpfile(from).moveTo(toFile.parent, toFile.leafName);
        }
760014
def dom(self):
        """"""
        try:
            dom = self._original_document.dom
            # cleaning doesn't return, just wipes in place
            html_cleaner(dom)
            return leaf_div_elements_into_paragraphs(dom)
        except ValueError:
            return None
171013
def copy(self):
        """"""
        return Poly(self.A.copy(), self.dim, self.shape,
            self.dtype)
561687
def _get_more_compressed(collection_name, num_to_return, cursor_id, ctx):
    """"""
    return _compress(
        2005, _get_more(collection_name, num_to_return, cursor_id), ctx)
1264043
def copy(self):
        """"""
        doppel = type(self)(
            self.unpack, self.apply, self.collect, self.reduce,
            apply_empty_slots=self.apply_empty_slots,
            extraneous=self.extraneous,
            ignore_empty_string=self.ignore_empty_string,
            ignore_none=self.ignore_none,
            visit_filter=self.visit_filter,
        )
        for x in self.cue:
            doppel.push(x)
        doppel.seen = self.seen
        return doppel
993306
def hash_full_tree(self, leaves):
        """"""
        root_hash, hashes = self._hash_full(leaves, 0, len(leaves))
        assert len(hashes) == count_bits_set(len(leaves))
        assert (self._hash_fold(hashes) == root_hash if hashes else
                root_hash == self.hash_empty())
        return root_hash
1344942
def __leaf(i, j, first, maxfirst, prevleaf, ancestor):
    
    jleaf = 0
    if i<=j or first[j] <= maxfirst[i]: return -1, jleaf
    maxfirst[i] = first[j]
    jprev = prevleaf[i]
    prevleaf[i] = j
    if jprev == -1: jleaf = 1
    else: jleaf = 2
    if jleaf == 1: return i, jleaf
    q = jprev
    while q != ancestor[q]: q = ancestor[q]
    s = jprev
    while s != q:
        sparent = ancestor[s]
        ancestor[s] = q
        s = sparent
    return q, jleaf
1248813
def flatten(d, sep='.'):
    """"""

    def _flatten(e, parent_key='', sep='.'):
        import collections

        prefix = parent_key + sep if parent_key else ''

        if isinstance(e, collections.MutableMapping):
            return tuple((prefix + k2, v2) for k, v in e.items() for k2, v2 in _flatten(v, k, sep))
        elif isinstance(e, collections.MutableSequence):
            return tuple((prefix + k2, v2) for i, v in enumerate(e) for k2, v2 in _flatten(v, str(i), sep))
        else:
            return (parent_key, (e,)),

    return tuple((k, v[0]) for k, v in _flatten(d, '', sep))
48315
private void compress() {
        if (sample.size() < 2) {
            return;
        }

        ListIterator<Item> it = sample.listIterator();
        int removed = 0;

        Item prev = null;
        Item next = it.next();

        while (it.hasNext()) {
            prev = next;
            next = it.next();

            if (prev.g + next.g + next.delta <= allowableError(it.previousIndex())) {
                next.g += prev.g;
                // Remove prev. it.remove() kills the last thing returned.
                it.previous();
                it.previous();
                it.remove();
                // it.next() is now equal to next, skip it back forward again
                it.next();
                removed++;
            }
        }
    }
953259
def deep_copy(self):
        
        return NominalColumn(self.arr, metadata=self.metadata, name=self.name,
                             missing_id=self._missing_id, substitute=False, weights=self.weights)
402943
public final Object decode(CachedData d) {
    Object obj = d.decodedObject;
    if (obj != null) {
      return obj;
    }
    byte[] data = d.data;

    int flags = d.flag;
    if ((flags & COMPRESSED) != 0) {
      data = decompress(data);
    }
    flags = flags & SPECIAL_MASK;
    obj = decode0(d, data, flags);
    d.decodedObject = obj;
    return obj;
  }
1302684
def leaves(self, prefix=None):
        
        prefix = coalesce(prefix, "")
        output = []
        for k, v in self.items():
            if _get(v, CLASS) in data_types:
                output.extend(wrap(v).leaves(prefix=prefix + literal_field(k) + "."))
            else:
                output.append((prefix + literal_field(k), v))
        return output
750574
def extract(self, disp):
        
        res = copy.deepcopy(self)
        for i in range(self.ndims):
            d = disp[i]
            s = self.domain[i]
            if d > 0:
                res.domain[i] = slice(s.start, d)
            elif d < 0:
                res.domain[i] = slice(d, s.stop)
        return res
504452
def copy(self):
        """"""
        cpy = self.__class__()
        cpy._autostep = self._autostep
        cpy.padding = self.padding
        cpy.update(self)
        return cpy