sets a bit, expanding the set size if necessary
325608
public void set(long index) {
        int wordNum = expandingWordNum(index);
        int bit = (int)index & 0x3f;
        long bitmask = 1L << bit;
        bits[wordNum] |= bitmask;
    }
490459
def _setuintbe(self, uintbe, length=None):
        """"""
        if length is not None and length % 8 != 0:
            raise CreationError("Big-endian integers must be whole-byte. "
                                "Length = {0} bits.", length)
        self._setuint(uintbe, length)
439500
public static void set(long[] bits, int pos) {
    int offset = pos >> LONG_SHIFT;
    if (offset >= bits.length)
      throw new IndexOutOfBoundsException();
    bits[offset] |= 1L << pos;
  }
192677
def frombits(cls, bits):
        """"""
        return cls.frombitsets(map(cls.BitSet.frombits, bits))
286141
def itemsize_bits(self):
        """"""
        if self.dtype is not None:
            return self.dtype.itemsize * 8
        else:
            return sum(x[1] for x in self.format)
1331351
def setbit(self, name, offset, value):
        
        with self.pipe as pipe:
            return pipe.setbit(self.redis_key(name), offset, value)
698883
function makeSet( length ) {
    var res = new Array( length );
    var i = -1;

    while( ++i < length ) {
        res[i] = i;
    }

    return new _set2.default( res );
}
155155
def set_bit(bitmask, bit, is_on):
    
    bitshift = bit - 1
    if is_on:
        return bitmask | (1 << bitshift)
    return bitmask & (0xff & ~(1 << bitshift))
337063
public boolean addAll(CompactIntSet ints) {
        int oldSize = size();
        bitSet.or(ints.bitSet);
        return oldSize != size();
    }
995085
def set_bit(self, offset, value):
        
        return self.database.setbit(self.key, offset, value)
436867
def _number_of_set_bits(x):
    '''
    
    '''
    # Taken from http://stackoverflow.com/a/4912729. Many thanks!
    x -= (x >> 1) & 0x55555555
    x = ((x >> 2) & 0x33333333) + (x & 0x33333333)
    x = ((x >> 4) + x) & 0x0f0f0f0f
    x += x >> 8
    x += x >> 16
    return x & 0x0000003f
1060880
public function bit_set($idx) // Set some bit
   {
      $byte = (int)floor($idx/8);
      $bit = $idx % 8;
      $this->data[$byte] = $this->data[$byte] | pow(2,$bit);
   }
793637
public void append24(int bits) {
        long l;
        long[] a1;
        l = ((l = crc) >> 8L) ^ (a1 = CRC32_TABLE)[(int) ((l & 0xFF) ^ (long) (bits & 0xFF))];
        l = (l >> 8L) ^ a1[(int) ((l & 0xFF) ^ (long) ((bits & 0xff00) >> 8))];
        crc = (l >> 8L) ^ a1[(int) ((l & 0xFF) ^ (long) ((bits & 0xff0000) >> 16))];
    }
1283322
def set_bit(self, position: int):
        
        if position > (self._bit_width - 1):
            raise ValueError('position greater than the bit width')

        self._value |= (1 << position)
        self._text_update()
584087
function setPrecision($bits)
    {
        $this->precision = $bits;
        if (MATH_BIGINTEGER_MODE != self::MODE_BCMATH) {
            $this->bitmask = new static(chr((1 << ($bits & 0x7)) - 1) . str_repeat(chr(0xFF), $bits >> 3), 256);
        } else {
            $this->bitmask = new static(bcpow('2', $bits, 0));
        }

        $temp = $this->_normalize($this);
        $this->value = $temp->value;
    }
924359
def fixup(p, data_bits, ptr_bits, bits_set):
    
    for i in range(ptr_bits):
        if 0 != bits_set & (1 << i):
            p.inst(X(data_bits + i))
420903
function zip_send_bits(
  value,	// value to send
  length) {	// number of bits
  /* If not enough room in bi_buf, use (valid) bits from bi_buf and
   * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
   * unused bits in value.
   */
  if (zip_bi_valid > zip_Buf_size - length) {
    zip_bi_buf |= (value << zip_bi_valid);
    zip_put_short(zip_bi_buf);
    zip_bi_buf = (value >> (zip_Buf_size - zip_bi_valid));
    zip_bi_valid += length - zip_Buf_size;
  } else {
    zip_bi_buf |= value << zip_bi_valid;
    zip_bi_valid += length;
  }
}