add in some more bytes
557182
def accumulate(self, buf):
        ''''''
        bytes = array.array('B')
        if isinstance(buf, array.array):
            bytes.extend(buf)
        else:
            bytes.fromstring(buf)
        accum = self.crc
        for b in bytes:
            tmp = b ^ (accum & 0xff)
            tmp = (tmp ^ (tmp<<4)) & 0xFF
            accum = (accum>>8) ^ (tmp<<8) ^ (tmp<<3) ^ (tmp>>4)
            accum = accum & 0xFFFF
        self.crc = accum
256099
def put(self, bytes):
        '''
        '''

        key = self.get_key_from_request()
        result_ttl = self.get_max_age()

        logger.debug(
            "[REDIS_RESULT_STORAGE] putting `{key}` with ttl `{ttl}`".format(
                key=key,
                ttl=result_ttl
            )
        )

        storage = self.get_storage()
        storage.set(key, bytes)

        if result_ttl > 0:
            storage.expireat(
                key,
                datetime.now() + timedelta(
                    seconds=result_ttl
                )
            )

        return key
1083462
function prependLength(data) {
	const lengthAsBytes = buffer.Buffer.alloc(4);

	lengthAsBytes.writeUInt32BE(data.length);

	return buffer.Buffer.concat([lengthAsBytes, data]);
}
274327
def add(self, port, pkt):
        '''
        
        '''
        id = len(self._buffer) + 1
        if id > self._buffsize:
            raise FullBuffer()

        self._buffer[id] = (port, deepcopy(pkt))
        return id
434294
def add_partition(self, p):
        """"""

        if not self.partitions:
            self.partitions = {}

        self.partitions[p.vid] = p
1292610
def supplement_filesystem(old_size, user_cap=False):
    """"""
    new_size = old_size
    if user_cap:
        if old_size <= _GiB_to_Byte(1.5):
            new_size = _GiB_to_Byte(3)
        else:
            new_size += _GiB_to_Byte(1.5)
    return int(new_size)
811460
def append(self, s):
        
        if self._compressor is None:
            return zlib.compress(self.s + s, 9)
        else:
            compressor = self._compressor.copy()
            out = self._out
            out += compressor.compress(s)
            return out + compressor.flush()
527057
def resize(self, new_data_size):
        """"""

        resize_bytes(
            self.__fileobj, self.data_size, new_data_size, self.data_offset)
        self._update_size(new_data_size)
175234
void increase() {
        // double the size
        length <<= 1;
        // There is no need to preserve what was in the memory before.
        ByteBuffer buffer = Buffer.allocateDirectWithNativeOrder(calculateBufferCapacity(length));
        Buffer.free(memory);
        memory = buffer;
        memoryAddress = Buffer.memoryAddress(buffer);
    }
883585
private void increaseCapacity() {
    int newCapacity = (valueslength.capacity() == 0) ? DEFAULT_INIT_SIZE
        : valueslength.capacity() < 64 ? valueslength.capacity() * 2
            : valueslength.capacity() < 1024 ? valueslength.capacity() * 3 / 2
                : valueslength.capacity() * 5 / 4;

    final ShortBuffer nv = ShortBuffer.allocate(newCapacity);
    valueslength.rewind();
    nv.put(valueslength);
    valueslength = nv;
  }
787127
def addImgStream(self, img):
        '''
        
        '''
        if self.findCount > self.max_images:
            raise EnoughImages('have enough images')
        return self.addImg(img)
1278099
def add(self, data):
		
		if len(self) + len(data) > self.sizelimit:
			raise OmapiSizeLimitError()
		self.buff.write(data)
		return self
381484
def bytes(self):
        """"""
        addrbyte = b'\x00\x00\x00'
        if self.addr is not None:
            addrbyte = self.addr
        return addrbyte
892931
protected void fillFromBytes(byte[] bytes)
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "fillFromBytes", com.ibm.ejs.util.Util.toHexString(bytes));

        _uuidHigh = (((long) bytes[0]) & 0xFF) << 56
                    | (((long) bytes[1]) & 0xFF) << 48
                    | (((long) bytes[2]) & 0xFF) << 40
                    | (((long) bytes[3]) & 0xFF) << 32
                    | (((long) bytes[4]) & 0xFF) << 24
                    | (((long) bytes[5]) & 0xFF) << 16
                    | (((long) bytes[6]) & 0xFF) << 8
                    | (((long) bytes[7]) & 0xFF) << 0;
        _uuidLow = (((long) bytes[8]) & 0xFF) << 56
                   | (((long) bytes[9]) & 0xFF) << 48
                   | (((long) bytes[10]) & 0xFF) << 40
                   | (((long) bytes[11]) & 0xFF) << 32
                   | (((long) bytes[12]) & 0xFF) << 24
                   | (((long) bytes[13]) & 0xFF) << 16
                   | (((long) bytes[14]) & 0xFF) << 8
                   | (((long) bytes[15]) & 0xFF) << 0;

        _cachedBytes = bytes;

        if (tc.isEntryEnabled())
            Tr.exit(tc, "fillFromBytes");
    }
684929
public void appendBytes(byte[] bs, int start, int len) {
        elems = ArrayUtils.ensureCapacity(elems, length + len);
        System.arraycopy(bs, start, elems, length, len);
        length += len;
    }
1328705
private void expandIfNecessary(int size) {
    if (bytes.length >= size) {
      // no need to expand
      return;
    }
    // either double, or expand to fit size
    int newlength = Math.max(2 * bytes.length, size);
    bytes = Arrays.copyOf(bytes, newlength);
  }
597034
def filesize(num_bytes):
    """"""
    for prefix in '-KMGTEPZY':
        if num_bytes < 999.9:
            break
        num_bytes /= 1000.0
    if prefix == '-':
        return '{} B'.format(num_bytes)
    return '{:.3n} {}B'.format(num_bytes, prefix)