Overwrite with bs at pos.
555280
def _overwrite(self, bs, pos):
        """"""
        assert 0 <= pos < self.len
        if bs is self:
            # Just overwriting with self, so do nothing.
            assert pos == 0
            return
        firstbytepos = (self._offset + pos) // 8
        lastbytepos = (self._offset + pos + bs.len - 1) // 8
        bytepos, bitoffset = divmod(self._offset + pos, 8)
        if firstbytepos == lastbytepos:
            mask = ((1 << bs.len) - 1) << (8 - bs.len - bitoffset)
            self._datastore.setbyte(bytepos, self._datastore.getbyte(bytepos) & (~mask))
            d = offsetcopy(bs._datastore, bitoffset)
            self._datastore.setbyte(bytepos, self._datastore.getbyte(bytepos) | (d.getbyte(0) & mask))
        else:
            # Do first byte
            mask = (1 << (8 - bitoffset)) - 1
            self._datastore.setbyte(bytepos, self._datastore.getbyte(bytepos) & (~mask))
            d = offsetcopy(bs._datastore, bitoffset)
            self._datastore.setbyte(bytepos, self._datastore.getbyte(bytepos) | (d.getbyte(0) & mask))
            # Now do all the full bytes
            self._datastore.setbyteslice(firstbytepos + 1, lastbytepos, d.getbyteslice(1, lastbytepos - firstbytepos))
            # and finally the last byte
            bitsleft = (self._offset + pos + bs.len) % 8
            if not bitsleft:
                bitsleft = 8
            mask = (1 << (8 - bitsleft)) - 1
            self._datastore.setbyte(lastbytepos, self._datastore.getbyte(lastbytepos) & mask)
            self._datastore.setbyte(lastbytepos,
                                    self._datastore.getbyte(lastbytepos) | (d.getbyte(d.bytelength - 1) & ~mask))
        assert self._assertsanity()
399260
def _corrupt(self, data, dpos):
        """"""
        ws = list(self._BLK_BE.unpack_from(data, dpos))
        for t in range(16, 80):
            tmp = ws[(t - 3) & 15] ^ ws[(t - 8) & 15] ^ ws[(t - 14) & 15] ^ ws[(t - 16) & 15]
            ws[t & 15] = ((tmp << 1) | (tmp >> (32 - 1))) & 0xFFFFFFFF
        self._BLK_LE.pack_into(data, dpos, *ws)
1315941
function rebaseHistSel(pos, from, to, diff) {
    if (to < pos.line) {
      pos.line += diff;
    } else if (from < pos.line) {
      pos.line = from;
      pos.ch = 0;
    }
  }
673161
private int skipPast(byte[] data, int pos, byte target) {
        int index = pos;
        while (index < data.length) {
            if (target == data[index++]) {
                return index;
            }
        }
        return index;
    }
957487
function writePrompt () {
        charm.position(1,1);
        charm.display('bright');
        charm.write(promptStart);
        charm.write(' ');
        charm.display('reset');
    }
393413
def _backward_kill_word(text, pos):
    "
    text, new_pos = _backward_word(text, pos)
    return text[:new_pos] + text[pos:], new_pos
1136846
function overwrite(obj, defaults) {
  var res = {};
  var dFlat = collapse(defaults);
  var oFlat = collapse(obj);
  for (var key in dFlat) {
    val(res, key, dFlat[key]);
  }
  for (var key in oFlat) {
    val(res, key, oFlat[key]);
  }
  return res;
}
806223
def _upcase_word(text, pos):
    """"""
    text, new_pos = _forward_word(text, pos)
    return text[:pos] + text[pos:new_pos].upper() + text[new_pos:], new_pos
177105
public final void overwrite(Map<Object, Object> data) {
        internalData.clear();
        internalData.putAll(data);
    }
279258
public void rawWarning(int pos, String msg) {
        PrintWriter warnWriter = writers.get(WriterKind.ERROR);
        if (nwarnings < MaxWarnings && emitWarnings) {
            printRawDiag(warnWriter, "warning: ", pos, msg);
        }
        prompt();
        nwarnings++;
        warnWriter.flush();
    }
266923
def overwrite_line(self, n, text):
        
        with self._moveback(n):
            self.term.stream.write(text)
1022377
def move_pos(line=1, column=1, file=sys.stdout):
    
    move.pos(line=line, col=column).write(file=file)
348990
public function overwrite($messages, $newline = true, $size = null, $verbosity = self::NORMAL)
    {
        $this->io->overwrite($messages, $newline, $verbosity);
    }
767325
def update(self, pos):
        
        self.pos = pos
        self.now = time.time()
1314788
def txn(self, overwrite=False, lock=True):
        """"""
        if lock:
            self._lock.acquire()
        try:
            new_state, existing_generation = self.state_and_generation
            new_state = copy.deepcopy(new_state)
            yield new_state
            if overwrite:
                existing_generation = None
            self.set_state(new_state, existing_generation=existing_generation)
        finally:
            if lock:
                self._lock.release()
1062307
def insert(self, bs, pos=None):
        
        bs = Bits(bs)
        if not bs.len:
            return self
        if bs is self:
            bs = self.__copy__()
        if pos is None:
            try:
                pos = self._pos
            except AttributeError:
                raise TypeError("insert require a bit position for this type.")
        if pos < 0:
            pos += self.len
        if not 0 <= pos <= self.len:
            raise ValueError("Invalid insert position.")
        self._insert(bs, pos)
604044
def cleanup(self):
        """"""
        self.num_puts = 0
        cached = []
        for i, url_data in enumerate(self.queue):
            key = url_data.cache_url
            cache = url_data.aggregate.result_cache
            if cache.has_result(key):
                cached.append(i)
        for pos in cached:
            self._move_to_top(pos)