Push bits into the target.

        value
            Integer containing bits to push, ordered from least-significant bit to
            most-significant bit.

        count
            Number of bits to push to the target.
508942
def put_bits( self, value, count ):
        
        for _ in range( count ):

            # bits are retrieved from the source LSB first
            bit = (value & 1)
            value >>= 1

            # however, bits are put into the result based on the rule
            if self.bits_reverse:
                if self.insert_at_msb:
                    self.current_bits |= (bit << (self.bits_remaining-1))
                else:
                    self.current_bits <<= 1
                    self.current_bits |= bit
            else:
                if self.insert_at_msb:
                    self.current_bits >>= 1
                    self.current_bits |= (bit << 7)
                else:
                    self.current_bits |= (bit << (8-self.bits_remaining))

            self.bits_remaining -= 1
            if self.bits_remaining <= 0:
                self.output.append( self.current_bits )

                self.current_bits = 0
                self.bits_remaining = 8
956106
private void doWrite(int bits, int count) {

		int frontBits = ((int) position) & 31;
		int firstInt = (int) (position >> 5);

		int sumBits = count + frontBits;
		if (sumBits <= 32) {
			int i = ints[firstInt];
			int mask = frontMask(frontBits) | backMask(sumBits);
			i &= mask;
			i |= (bits << (32 - sumBits)) & ~mask;
			ints[firstInt] = i;
		} else {
			int i = ints[firstInt];
			int mask = frontMask(frontBits);
			i &= mask;
			int lostBits = sumBits - 32;
			i |= (bits >> lostBits) & ~mask;
			ints[firstInt] = i;

			i = ints[firstInt + 1];
			mask = backMask(lostBits);
			i &= mask;
			i |= (bits << (32 - lostBits)) & ~mask;
			ints[firstInt + 1] = i;
		}
	}
268489
public void append(short bits) {
        long l;
        long[] a1;
        l = ((l = crc) >> 8L) ^ (a1 = CRC32_TABLE)[(int) ((l & 0xFF) ^ (long) (bits & 0xFF))];
        crc = (l >> 8L) ^ a1[(int) ((l & 0xFF) ^ (long) ((bits & 0xffff) >> 8))];
    }
580135
public static final int move(byte[] buf, int offset, int length, ByteBuffer bb)
    {
        int count = Math.min(length, bb.remaining());
        bb.put(buf, offset, count);
        return count;
    }
691129
def _bit_value(self, group, val):
        """"""
        bitshift = group - 1
        if val:
            new_value = self._value | (1 << bitshift)
        else:
            new_value = self._value & (0xff & ~(1 << bitshift))
        return new_value
27385
private static FDBigInteger valueOfPow2(int p2) {
        int wordcount = p2 >> 5;
        int bitcount = p2 & 0x1f;
        return new FDBigInteger(new int[]{1 << bitcount}, wordcount);
    }
36288
public void setBitCount(int count) {
        bitCount = count;
        discretes = new BitVector(count);
        //set correct length, without counting unitid and fc
        setDataLength(discretes.byteSize() + 1);
    }
1341126
def _take_bits(buf, count):
    """"""

    # TODO: Verify output
    bytes_count = (count + 7) // 8
    bytes_mod = count % 8
    data = _unpack_from(buf, 'B', bytes_count)
    values = []
    for i, byte in enumerate(data):
        for _ in range(8 if i != bytes_count - 1 else bytes_mod):
            # TODO: Convert to True / False
            values.append(byte & 0b10000000)
            byte <<= 1
    return values
720511
public final void push(int value)
  {

    int ff = m_firstFree;

    if ((ff + 1) >= m_mapSize)
    {
      if (null == m_map)
      {
        m_map = new int[m_blocksize];
        m_mapSize = m_blocksize;
      }
      else
      {
        m_mapSize += m_blocksize;

        int newMap[] = new int[m_mapSize];

        System.arraycopy(m_map, 0, newMap, 0, ff + 1);

        m_map = newMap;
      }
    }

    m_map[ff] = value;

    ff++;

    m_firstFree = ff;
  }
417087
private int countNumberOfBitsSetToOne() {

    AtomicInteger numberOfBitsSetToOne = new AtomicInteger(0);

    stream(getBitArray()).forEach(bucket -> {
      for (int bitMask : BIT_MASKS) {
        if ((bucket & bitMask) != 0) {
          numberOfBitsSetToOne.incrementAndGet();
        }
      }
    });

    return numberOfBitsSetToOne.get();
  }
177983
def push(self, element, value):
        
        insert_pos = 0
        for index, el in enumerate(self.tops):
            if not self.find_min and el[1] >= value:
                insert_pos = index+1
            elif self.find_min and el[1] <= value:
                insert_pos = index+1
        self.tops.insert(insert_pos, [element, value])
        self.tops = self.tops[:self.n]
519374
function setBit (buffer, pos, bit) {
  const byte = Math.floor(pos / 8)
  const bitPos = pos % 8

  if (bit === 0) {
    const mask = 255 - (1 << bitPos)
    buffer[byte] &= mask
  } else {
    const mask = (1 << bitPos)
    buffer[byte] |= mask
  }
}
741468
public static int setBit(int value, int bitNumber, boolean bitValue) {
    if (bitValue) {
      return setBitOn(value, bitNumber);
    } else {
      return setBitOff(value, bitNumber);
    }
  }
368562
def get_bit(self, position: int):
        

        if position > (self._bit_width - 1):
            raise ValueError('position greater than the bit width')

        if self._value & (1 << position):
            return 1
        else:
            return 0
1353335
public JBBPOut Bit(final byte value) throws IOException {
    assertNotEnded();
    if (this.processCommands) {
      this._writeBits(JBBPBitNumber.BITS_1, value);
    }
    return this;
  }
1285988
void push( int slots ) {
    assert 0 <= slots && slots < 1000;
    int len = _d.length;
    _sp += slots;
    while( _sp > len ) {
      _key= Arrays.copyOf(_key,len<<1);
      _ary= Arrays.copyOf(_ary,len<<1);
      _d  = Arrays.copyOf(_d  ,len<<1);
      _fcn= Arrays.copyOf(_fcn,len<<=1);
      _str= Arrays.copyOf(_str,len<<1);
    }
  }
359613
private void pushOutputValues(ValueNumber[] outputValueList) {
        ValueNumberFrame frame = getFrame();
        for (ValueNumber aOutputValueList : outputValueList) {
            frame.pushValue(aOutputValueList);
        }
    }