Set elements of arrb true if their indexes appear in arrb.
345899
public static void intIndexesToBooleanArray(int[] arra, boolean[] arrb) {

        for (int i = 0; i < arra.length; i++) {
            if (arra[i] < arrb.length) {
                arrb[arra[i]] = true;
            }
        }
    }
1214222
public void set(int index, boolean value)
    {
        check(index);
        if (value)
        {
            array[index / 8] |= (1 << (index % 8));
        }
        else
        {
            array[index / 8] &= ~(1 << (index % 8));
        }
    }
1208063
public static boolean haveEqualArrays(int[] arra, int[] arrb, int count) {

        if (count > arra.length || count > arrb.length) {
            return false;
        }

        for (int j = 0; j < count; j++) {
            if (arra[j] != arrb[j]) {
                return false;
            }
        }

        return true;
    }
1108173
def index_sets(self, as_set=False):
        """"""
        indexes = frozenset if as_set else tuple
        return [indexes(b.iter_set()) for b in self]
1152930
def p_array_indices(self, p):
        ''''''
        if len(p) == 2:
            p[0] = p[1],
        else:
            p[0] = (p[1],) + p[3]
1011823
def set_bool(_bytearray, byte_index, bool_index, value):
    
    assert value in [0, 1, True, False]
    current_value = get_bool(_bytearray, byte_index, bool_index)
    index_value = 1 << bool_index

    # check if bool already has correct value
    if current_value == value:
        return

    if value:
        # make sure index_v is IN current byte
        _bytearray[byte_index] += index_value
    else:
        # make sure index_v is NOT in current byte
        _bytearray[byte_index] -= index_value
790394
def set_row(self, index, values):
        
        if self._sort:
            exists, i = sorted_exists(self._index, index)
            if not exists:
                self._insert_row(i, index)
        else:
            try:
                i = self._index.index(index)
            except ValueError:  # new row
                i = len(self._index)
                self._add_row(index)
        if isinstance(values, dict):
            if not (set(values.keys()).issubset(self._columns)):
                raise ValueError('keys of values are not all in existing columns')
            for c, column in enumerate(self._columns):
                self._data[c][i] = values.get(column, self._data[c][i])
        else:
            raise TypeError('cannot handle values of this type.')
1284617
def set_checks(self, checks, position=None):
        """"""
        if position is None:
            position = self.position
        self.checkdefs[position][0] = checks
101096
def setCheckedIndexes(self, indexes):
        
        if not self.isCheckable():
            return
        
        model = self.model()
        model.blockSignals(True)
        for i in range(self.count()):
            if not self.itemText(i):
                continue
            
            item = model.item(i)
            
            if i in indexes:
                state = Qt.Checked
            else:
                state = Qt.Unchecked
                
            item.setCheckState(state)
        model.blockSignals(False)
        self.updateCheckedText()
871915
def add_index(self, values, name=None):
        ''
        if len(values) != len(set(values)):
            raise ValueError('Values in the new index are not unique')

        d = self.indices
        if len(values) != len(self) and len(values) and d:
            raise ValueError('Length of values in added index (%s) does not match '
                             'length of existing items (%s)' % (len(values), len(self)))

        if name is None:
            name = 'index_' + str(len(d)+1)
            name = get_unique_name(name, d)
        else:
            MI_check_index_name(name)
            if name in d:
                raise ValueError('Duplicate index name: %s' % (name,))

        if len(d) == 0:
            items = [(v,) for v in values]
        else:
            items = [i+(v,) for i, v in zip(self.items(), values)]

        names = force_list(d.keys()) + [name]

        self.clear(True)
        _MI_init(self, items, names)
875434
def []=(index,value)
      if self.shape.count != 1 or index >= self.shape[0]
        raise IndexError.new("You can only set values for array values")
      else
        @array_image[get_index_value(index)] = value
      end
    end
1292834
public function setIndexes(array $indexes)
    {
        $this->indexes = array();

        foreach ($indexes as $index) {
            $this->addIndex($index);
        }
    }
848759
private void checkIndices(int... indices) {
        if (indices.length != dims.length) {
            throw new IllegalArgumentException(String.format(
                    "Indices array is not the correct length. expected=%d actual=%d", 
                    indices.length, dims.length));
        }
        for (int i=0; i<indices.length; i++) {
            if (indices[i] < 0 || dims[i] <= indices[i]) {
                throw new IllegalArgumentException(String.format(
                        "Indices array contains an index that is out of bounds: i=%d index=%d", 
                        i, indices[i]));
            }
        }
    }
934650
public static boolean containsAt(byte[] arra, int start, byte[] arrb) {
        return countSameElements(arra, start, arrb) == arrb.length;
    }
288190
boolean set(long index) {
    if (!get(index)) {
      data[(int) (index >>> 6)] |= (1L << index);
      bitCount++;
      return true;
    }
    return false;
  }
405749
def _check_index_in_compilations(context: BaseContext, index: str):
    """"""
    compilations = 'compilations'
    if compilations not in context.shared_data:
        return False
    return index in context.shared_data[compilations]
456133
def setData(self, index, value, role):
        """"""
        row = index.row()
        name, state = self.row(row)

        if role == Qt.CheckStateRole:
            self.set_row(row, [name, not state])
            self._parent.setCurrentIndex(index)
            self._parent.setFocus()
            self.dataChanged.emit(index, index)
            return True
        elif role == Qt.EditRole:
            self.set_row(row, [from_qvariant(value, to_text_string), state])
            self.dataChanged.emit(index, index)
            return True
        return True