Resizes the filesystem.

    CLI Example:
    .. code-block:: bash

        salt '*' disk.resize2fs /dev/sda1
973330
def resize2fs(device):
    '''
    
    '''
    cmd = 'resize2fs {0}'.format(device)
    try:
        out = __salt__['cmd.run_all'](cmd, python_shell=False)
    except subprocess.CalledProcessError as err:
        return False
    if out['retcode'] == 0:
        return True
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;
      }
    }
  }
65789
def resize(self, size=None):
        

        if not self.israw():
            return

        size = size or tty.size(self.stdout)

        if size is not None:
            rows, cols = size
            try:
                self.client.resize(self.container, height=rows, width=cols)
            except IOError: # Container already exited
                pass
637241
def resize_lazy(image, width=None, height=None, crop=False, force=False,
                namespace="resized", storage=default_storage,
                as_url=False):
    
    # First normalize params to determine which file to get
    width, height, crop = _normalize_params(image, width, height, crop)
    # Fetch the name of the resized image so i can test it if exists
    name = _get_resized_name(image, width, height, crop, namespace)

    # Fetch storage if an image has a specific storage
    try:
        storage = image.storage
    except AttributeError:
        pass

    # Test if exists or force
    if force or not storage.exists(name):
        resized_image = None
        try:
            resized_image = resize(image, width, height, crop)
            name = storage.save(name, resized_image)
        finally:
            if resized_image is not None:
                resized_image.close()

    if as_url:
        return storage.url(name)

    return name
216519
protected void resizeBuckets (int newsize)
    {
        Record[] oldbuckets = _buckets;
        _buckets = new Record[newsize];

        // we shuffle the records around without allocating new ones
        int index = oldbuckets.length;
        while (index-- > 0) {
            Record oldrec = oldbuckets[index];
            while (oldrec != null) {
                Record newrec = oldrec;
                oldrec = oldrec.next;

                // always put the newrec at the start of a chain
                int newdex = Math.abs(newrec.key)%_buckets.length;
                newrec.next = _buckets[newdex];
                _buckets[newdex] = newrec;
            }
        }
    }
622003
def copy_sizes(self, othervd):
        # type: (PrimaryOrSupplementaryVD) -> None
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('This Volume Descriptor is not yet initialized')

        self.space_size = othervd.space_size
        self.path_tbl_size = othervd.path_tbl_size
        self.path_table_num_extents = othervd.path_table_num_extents
901786
def resize(self, size):
		
		if size < len(self):
			raise ValueError("Value is out of bound. Array can't be shrinked")
		current_size = self.__size
		for i in range(size - current_size):
			self.__array.append(WBinArray(0, self.__class__.byte_size))
		self.__size = size
637709
def resize!
      begin
        image = MiniMagick::Image.open(@file.path)
        image.resize("#{@width}x#{@height}")
      rescue
        # Pass on any error
      else
        image.write(@file.path) rescue nil
      end
    end
1112572
private void resize(int newCapacity) {
        // assert (newCapacity & -newCapacity) == newCapacity; // power of 2
        int newLength = newCapacity * 2;

        long[] oldTable = table;
        int oldLength = oldTable.length;
        if (oldLength == 2*MAXIMUM_CAPACITY) { // can't expand any further
            if (threshold == MAXIMUM_CAPACITY-1)
                throw new IllegalStateException("Capacity exhausted.");
            threshold = MAXIMUM_CAPACITY-1;  // Gigantic map!
            return;
        }
        if (oldLength >= newLength)
            return;

        long[] newTable = new long[newLength];
        threshold = (newCapacity * 3) / 4;

        for (int j = 0; j < oldLength; j += 2) {
            long key = oldTable[j];
            if (key != 0) {
                long value = oldTable[j+1];
                int i = hash(key, newLength);
                while (newTable[i] != 0)
                    i = nextKeyIndex(i, newLength);
                newTable[i] = key;
                newTable[i + 1] = value;
            }
        }
        table = newTable;
    }
1292610
def supplement_filesystem(old_size, user_cap=False):
    """"""
    new_size = old_size
    if user_cap:
        if old_size <= _GiB_to_Byte(1.5):
            new_size = _GiB_to_Byte(3)
        else:
            new_size += _GiB_to_Byte(1.5)
    return int(new_size)
384115
private void resize(Object[] oldTable, int newSize)
    {
        int oldCapacity = oldTable.length;
        int end = oldCapacity - 1;
        Object last = arrayAt(oldTable, end);
        if (this.size() < ((end*3) >> 2) && last == RESIZE_SENTINEL)
        {
            return;
        }
        if (oldCapacity >= MAXIMUM_CAPACITY)
        {
            throw new RuntimeException("max capacity of map exceeded");
        }
        ResizeContainer resizeContainer = null;
        boolean ownResize = false;
        if (last == null || last == RESIZE_SENTINEL)
        {
            synchronized (oldTable) // allocating a new array is too expensive to make this an atomic operation
            {
                if (arrayAt(oldTable, end) == null)
                {
                    setArrayAt(oldTable, end, RESIZE_SENTINEL);
                    resizeContainer = new ResizeContainer(allocateTable(newSize), oldTable.length - 2);
                    setArrayAt(oldTable, end, resizeContainer);
                    ownResize = true;
                }
            }
        }
        if (ownResize)
        {
            this.transfer(oldTable, resizeContainer);

            Object[] src = this.table;
            while (!TABLE_UPDATER.compareAndSet(this, oldTable, resizeContainer.nextArray))
            {
                // we're in a double resize situation; we'll have to go help until it's our turn to set the table
                if (src != oldTable)
                {
                    this.helpWithResize(src);
                }
            }
        }
        else
        {
            this.helpWithResize(oldTable);
        }
    }
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;
    }
518015
def resize_img(fname, targ, path, new_path, fn=None):
    
    if fn is None:
        fn = resize_fn(targ)
    dest = os.path.join(path_for(path, new_path, targ), fname)
    if os.path.exists(dest): return
    im = Image.open(os.path.join(path, fname)).convert('RGB')
    os.makedirs(os.path.split(dest)[0], exist_ok=True)
    fn(im).save(dest)
1115560
def resize(self, height, width, **kwargs):
        
        self.client.exec_resize(self.exec_id, height=height, width=width)
1099430
def resized(*args, **kwargs):
    
    resized_image = None
    try:
        resized_image = resize(*args, **kwargs)
        yield resized_image
    finally:
        if resized_image is not None:
            resized_image.close()
717771
def getsize(self, path):
        
        try:
            file_obj = self.filesystem.resolve(path)
            if (self.filesystem.ends_with_path_separator(path) and
                    S_IFMT(file_obj.st_mode) != S_IFDIR):
                error_nr = (errno.EINVAL if self.filesystem.is_windows_fs
                            else errno.ENOTDIR)
                self.filesystem.raise_os_error(error_nr, path)
            return file_obj.st_size
        except IOError as exc:
            raise os.error(exc.errno, exc.strerror)
1188597
def resize_old(self, block_size, order=0, mode='constant', cval=False):
        '''
        
        '''
        if not cval:
            cval = np.nan
        if (self.raster.dtype.name.find('float') != -1 and
            np.max(np.abs([self.max(), self.min()])) > 1):
            raster2 = (self.raster-self.min())/(self.max()-self.min())
        else:
            raster2 = self.raster.copy()
        raster2 = raster2.astype(float)
        raster2[self.raster.mask] = np.nan
        raster2 = resize(raster2, block_size, order=order, mode=mode, cval=cval)
        raster2 = np.ma.masked_array(raster2, mask=np.isnan(raster2),
                                     fill_value=self.raster.fill_value)
        raster2 = raster2*(self.max()-self.min())+self.min()
        raster2[raster2.mask] = self.nodata_value
        raster2.mask = np.logical_or(np.isnan(raster2.data), raster2.data == self.nodata_value)
        geot = list(self.geot)
        [geot[-1], geot[1]] = np.array([geot[-1], geot[1]])*self.shape/block_size
        return GeoRaster(raster2, tuple(geot), nodata_value=self.nodata_value,\
                        projection=self.projection, datatype=self.datatype)