Resize the internal table to given capacity.
556237
@SuppressWarnings("unchecked")
  private void resize(int cap) {
    int newCapacity = computeCapacity(cap);
    if (newCapacity == this.capacity) {
      return;
    }
    this.capacity = newCapacity;
    this.expandThreshold = (int) (capacity * maxLoadFactor);
    this.shrinkThreshold = (int) (capacity * minLoadFactor);
    this.hash_mask = capacity - 1;
    LinkedElement<T>[] temp = entries;
    entries = new LinkedElement[capacity];
    for (int i = 0; i < temp.length; i++) {
      LinkedElement<T> curr = temp[i];
      while (curr != null) {
        LinkedElement<T> next = curr.next;
        int index = getIndex(curr.hashCode);
        curr.next = entries[index];
        entries[index] = curr;
        curr = next;
      }
    }
  }
615274
def do_capacity(self, line):
        ""
        table, line = self.get_table_params(line)
        args = self.getargs(line)

        read_units = int(args[0])
        write_units = int(args[1])

        desc = table.describe()
        prov = desc['Table']['ProvisionedThroughput']

        current_read, current_write = prov['ReadCapacityUnits'], prov['WriteCapacityUnits']
        if read_units < current_read or write_units < current_write:
            print "%s: updating capacity to %d read units, %d write units" % (table.table_name, read_units, write_units)
            print ""
            if not table.update(throughput={'read': read_units, 'write': write_units}):
                print "update failed"
            else:
                self.do_refresh(table.table_name)

        else:
            print "%s: current capacity is %d read units, %d write units" % (table.table_name, current_read, current_write)
            # we can only double the current value at each call
            while current_read < read_units or current_write < write_units:
                if (read_units - current_read) > current_read:
                    current_read *= 2
                else:
                    current_read = read_units

                if (write_units - current_write) > current_write:
                    current_write *= 2
                else:
                    current_write = write_units

                print "%s: updating capacity to %d read units, %d write units" % (table.table_name, current_read, current_write)
                if not table.update({'read': current_read, 'write': current_write}):
                    print ""
                    print "update failed"
                    print ""
                    break
                else:
                    print ""
                    self.do_refresh(table.table_name)
                    print ""
635601
def _resize_blob(self, ud, size):
        # type: (Uploader, blobxfer.models.upload.Descriptor, int) -> None
        
        blobxfer.operations.azure.blob.page.resize_blob(ud.entity, size)
        if blobxfer.util.is_not_empty(ud.entity.replica_targets):
            for ase in ud.entity.replica_targets:
                blobxfer.operations.azure.blob.page.resize_blob(ase, size)
722879
private void resize(int s) {
        int[] n;
        int count;

        n = new int[s];
        count = (s < data.length)? s : data.length;
        System.arraycopy(data, 0, n, 0, count);
        data = n;
    }
949175
def _setsizes(self, cursor=None):
        """"""
        if cursor is None:
            cursor = self._cursor
        if self._inputsizes:
            cursor.setinputsizes(self._inputsizes)
        for column, size in self._outputsizes.items():
            if column is None:
                cursor.setoutputsize(size)
            else:
                cursor.setoutputsize(size, column)
487287
def dbsize(host=None, port=None, db=None, password=None):
    '''
    
    '''
    server = _connect(host, port, db, password)
    return server.dbsize()
3453
def _resizeCurrentColumnToContents(self, new_index, old_index):
        """"""
        if new_index.column() not in self._autosized_cols:
            # Ensure the requested column is fully into view after resizing
            self._resizeVisibleColumnsToContents()
            self.dataTable.scrollTo(new_index)
1244489
def _update_header_size(self):
        """"""
        column_count = self.table_header.model().columnCount()
        for index in range(0, column_count):
            if index < column_count:
                column_width = self.dataTable.columnWidth(index)
                self.table_header.setColumnWidth(index, column_width)
            else:
                break
101761
private void resize(int needSpaceFor) {
        char[] old = mBuffer;
        int oldLen = old.length;
        int addition = oldLen >> 1; // Grow by 50%
        needSpaceFor -= (oldLen - mBufferLen);
        if (addition < needSpaceFor) {
            addition = needSpaceFor;
        }
        mBuffer = new char[oldLen+addition];
        System.arraycopy(old, 0, mBuffer, 0, mBufferLen);
    }
909394
protected final void checkResize() {
        if (size == table.length) { // size / table.length > DENSITY
            int forSize = table.length + 1; // size + 1;
            for (int i=0, newCapacity = MIN_CAPA; i < PRIMES.length; i++, newCapacity <<= 1) {
                if (newCapacity > forSize) {
                    resize(PRIMES[i]);
                    return;
                }
            }
            return;
        }
    }
1164294
def _shrink(self):
        
        cursize = self._current_size
        while cursize > self._maxsize:
            name, value = self.dynamic_entries.pop()
            cursize -= table_entry_size(name, value)
        self._current_size = cursize
646850
def resize(self, size):
        
        if isinstance(self._data, Array):
            self._data.resize(size)
514204
def truncate(self, table):
        """"""
        if isinstance(table, (list, set, tuple)):
            for t in table:
                self._truncate(t)
        else:
            self._truncate(table)
1115560
def resize(self, height, width, **kwargs):
        
        self.client.exec_resize(self.exec_id, height=height, width=width)
34421
def resize(self):
        """"""
        yext = self.system.dae.m - len(self.unamey)
        xext = self.system.dae.n - len(self.unamex)
        if yext > 0:
            self.unamey.extend([''] * yext)
            self.fnamey.extend([''] * yext)
        if xext > 0:
            self.unamex.extend([''] * xext)
            self.fnamex.extend([''] * xext)
561059
private void reallocate(int capacity) {
    if (capacity != elements.length) {
      assert (size <= capacity);
      float[] newArray = new float[capacity];
      for (int i = 0; i < size; i++) {
        newArray[i] = elements[i];
      }
      elements = newArray;
    }
  }
842344
def check_for_resize
      while (current_table = table) && MAX_CAPACITY > (table_size = current_table.size) && NOW_RESIZING != (size_ctrl = size_control) && size_ctrl < @counter.sum
        try_in_resize_lock(current_table, size_ctrl) do
          self.table = rebuild(current_table)
          (table_size << 1) - (table_size >> 1) # 75% load factor
        end
      end
    end