Set bit at pos to 1.
976514
def _set(self, pos):
        """"""
        assert 0 <= pos < self.len
        self._datastore.setbit(pos)
68628
private void setCurrentPosition(long pos) {
        if (pos == Long.MAX_VALUE) {
            pos = file.length();
        }
        if (!useLoadBuf) {
            in.position((int) pos);
            return;
        }
        try {
            if (pos >= (channel.position() - in.limit()) && pos < channel.position()) {
                in.position((int) (pos - (channel.position() - in.limit())));
            } else {
                channel.position(pos);
                fillBuffer(bufferSize, true);
            }
        } catch (Exception e) {
            log.error("Error setCurrentPosition", e);
        }

    }
1004205
def _setsie(self, i):
        """"""
        if not i:
            self._setbin_unsafe('1')
        else:
            self._setuie(abs(i))
            self._append(Bits([i < 0]))
277117
def pos_to_block(pos, len)
      start_block, start_byte = pos.divmod(@sb.block_size)
      end_block, _end_byte = (pos + len - 1).divmod(@sb.block_size)
      nblocks = end_block - start_block + 1
      return start_block, start_byte, nblocks
    end
899466
def setbit(self, name, offset, value):
        
        value = value and 1 or 0
        return self.execute_command('SETBIT', name, offset, value)
695459
def set_digit(self, pos, digit, decimal=False):
        
        if self.invert:
            self.set_digit_raw(pos, IDIGIT_VALUES.get(str(digit).upper(), 0x00))
        else:
            self.set_digit_raw(pos, DIGIT_VALUES.get(str(digit).upper(), 0x00))

        if decimal:
            self.set_decimal(pos, True)
636883
public static boolean get(long[] bits, int pos) {
    int offset = pos >> LONG_SHIFT;
    if (offset >= bits.length)
      return false;
    return (bits[offset] & (1L << pos)) != 0;
  }
1124650
public void set(int bit, boolean value) {
    int bite = byteForBit(bit);
    ensureSpace(bite + 1);
    int bitOnByte = bitOnByte(bit, bite);
    if (value) {
      bits[bite] = byteBitSet(bitOnByte, bits[bite]);
    } else {
      bits[bite] = byteBitUnset(bitOnByte, bits[bite]);
    }
  }
544128
function bitpos(key, bit, start, end /* req */) {
  var req = typeof arguments[arguments.length - 1] === 'object'
    ? arguments[arguments.length - 1] : null
    , buf = this.getValueBuffer(key, req, true)
    , i
    , ind;

  if(buf === undefined) buf = new Buffer('');
  if(bit && !buf.length) return -1;

  // got start/end range
  if(arguments.length >= 3) {
    if(start < 0) start = buf.length + start;
    if(start < 0) start = 0;
    if(end < 0) end = buf.length + end;
    if(end < 0) end = 0;
    if(end > buf.length || end === undefined) end = buf.length;
  }else{
    start = 0;
    end = buf.length;
  }

  if(typeof start === 'object') start = 0;
  if(typeof end === 'object') end = buf.length;

  // get the range we are inspecting
  buf = buf.slice(start, end + 1);

  function getBitPos(bit, byte, index) {
    var mask = [0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01]
      , i;
    for(i = 0;i < mask.length;i++) {
      if(bit && (byte & mask[i]) || !bit && !(byte & mask[i])) {
        return index + i;
      }
    }
    return -1;
  }

  for(i = 0;i < buf.length;i++) {
    ind = getBitPos(bit, buf[i], (start + i) * 8);
    if(~ind) return ind;
  }

  // looking for clear bit, but all bits set
  if(!bit) return i * 8;

  return -1;
}
772108
def set_position(self, pos):
        """"""
        time_in_ms = int(pos)*1000
        return self.apple_tv.set_property('dacp.playingtime', time_in_ms)
203728
def _set_raw(target, raw_value, bitarray):
        '''  '''
        offset = int(target['offset'])
        size = int(target['size'])
        for digit in range(size):
            bitarray[offset+digit] = (raw_value >> (size-digit-1)) & 0x01 != 0
        return bitarray
816042
def _readue(self, pos):
        
        oldpos = pos
        try:
            while not self[pos]:
                pos += 1
        except IndexError:
            raise ReadError("Read off end of bitstring trying to read code.")
        leadingzeros = pos - oldpos
        codenum = (1 << leadingzeros) - 1
        if leadingzeros > 0:
            if pos + leadingzeros + 1 > self.len:
                raise ReadError("Read off end of bitstring trying to read code.")
            codenum += self._readuint(leadingzeros, pos + 1)
            pos += leadingzeros + 1
        else:
            assert codenum == 0
            pos += 1
        return codenum, pos
353203
def putsz(self, addr, s):
        """"""
        self.puts(addr, s)
        self._buf[addr+len(s)] = 0
1089382
function _makeBitReversal() {
    var i = 0,
        j = 0,
        k = 0;
    _bitrev[0] = 0;
    while(++i < _n) {
      k = _n >> 1;
      while(k <= j) {
        j -= k;
        k >>= 1;
      }
      j += k;
      _bitrev[i] = j;
    }
  }
1013199
def set(bit)
      quotient = bit >> 3
      remainder = bit & 0x7
      mask = 0x80 >> remainder

      raise "Bit #{bit} out of range of bitfield with length #{length}" if quotient >= @data.length
      @data[quotient] |= mask
    end
30066
public int set(int pos) {

        while (pos >= capacity) {
            doubleCapacity();
        }

        if (pos >= limitPos) {
            limitPos = pos + 1;
        }

        int windex = pos >> 5;
        int mask   = 0x80000000 >>> (pos & 0x1F);
        int word   = map[windex];
        int result = (word & mask) == 0 ? 0
                                        : 1;

        map[windex] = (word | mask);

        return result;
    }
1295888
def set_position(self, val):
        """"""
        if val == 0:
            self.close()
        else:
            setlevel = 255
            if val < 1:
                setlevel = val * 100
            elif val <= 0xff:
                setlevel = val
            set_command = StandardSend(
                self._address, COMMAND_LIGHT_ON_0X11_NONE, cmd2=setlevel)
            self._send_method(set_command, self._open_message_received)