Reduce the size of this block

        :param int new_size: The new size
        :return: None
4838
def shrink(self, new_size):
        
        self.size = new_size

        if self.sort == 'string':
            self.null_terminated = False # string without the null byte terminator
            self._content[0] = self._content[0][ : self.size]

        elif self.sort == 'pointer-array':
            pointer_size = self.binary.project.arch.bytes

            if self.size % pointer_size != 0:
                # it's not aligned?
                raise BinaryError('Fails at Data.shrink()')

            pointers = self.size // pointer_size
            self._content = self._content[ : pointers]

        else:
            # unknown
            self._content =  [ self._content[0][ : self.size ] ]
848050
def calculate_size(name, new_value):
    
    data_size = 0
    data_size += calculate_size_str(name)
    data_size += BOOLEAN_SIZE_IN_BYTES
    if new_value is not None:
        data_size += calculate_size_data(new_value)
    return data_size
1128695
def set_size(self, size):
        
        if not isinstance(size, baseinteger):
            raise TypeError("size can only be an instance of type baseinteger")
        self._call("setSize",
                     in_p=[size])
1257758
def resize(self, block_size, order=0, mode='constant', cval=False, preserve_range=True):
        '''
        
        '''
        if not cval:
            cval = np.nan
        raster2 = resize(self.raster.data, block_size, order=order, mode=mode,
                         cval=cval, preserve_range=preserve_range)
        mask = resize(self.raster.mask, block_size, order=order, mode=mode,
                      cval=cval, preserve_range=preserve_range)
        raster2 = np.ma.masked_array(raster2, mask=mask, fill_value=self.raster.fill_value)
        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)
431960
public void shrink (int maximumCapacity) {
		if (maximumCapacity < 0) throw new IllegalArgumentException("maximumCapacity must be >= 0: " + maximumCapacity);
		if (size > maximumCapacity) maximumCapacity = size;
		if (capacity <= maximumCapacity) return;
		maximumCapacity = nextPowerOfTwo(maximumCapacity);
		resize(maximumCapacity);
	}
758025
private void resizeBuf(int size)
    {
        int capacity;
        if (size >= _capacity * 2)
        {
            capacity = size;
        }
        else
        {
            capacity = 1;
            while (capacity < size)
            {
                capacity <<= 1;
            }
        }
        byte[] buf = new byte[capacity];
        if (_size > 0)
        {
            System.arraycopy(_buf, 0, buf, 0, _size);
        }
        _buf = buf;
        _capacity = capacity;
    }
862571
protected void resize(int new_length) {
        if(keys == null) {
            keys=new byte[Math.min(new_length, 0xff)][];
            values=new byte[Math.min(new_length, 0xff)][];
            return;
        }
        if(new_length > 0xff) {
            if(keys.length < 0xff)
                new_length=0xff;
            else
                throw new ArrayIndexOutOfBoundsException("the hashmap cannot exceed " + 0xff + " entries");
        }

        keys=Arrays.copyOf(keys, new_length);
        values=Arrays.copyOf(values, new_length);
    }
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;
    }
62001
def _set_bulk_size(self, bulk_size):
        
        self._bulk_size = bulk_size
        self.bulker.bulk_size = bulk_size
147843
def chunkify(chunksize):
    

    def chunkifier(func):

        def wrap(*args):

            assert len(args) > 0
            assert all(len(a.flat) == len(args[0].flat) for a in args)

            nelements = len(args[0].flat)
            nchunks, remain = divmod(nelements, chunksize)

            out = np.ndarray(args[0].shape)

            for start in range(0, nelements, chunksize):
                #print(start)
                stop = start+chunksize
                if start+chunksize > nelements:
                    stop = nelements-start
                iargs = tuple(a.flat[start:stop] for a in args)
                out.flat[start:stop] = func(*iargs)
            return out

        return wrap

    return chunkifier
791826
def dilate(self, size):
        
        if size > 0:
            from scipy.ndimage.morphology import binary_dilation
            size = (size * 2) + 1
            coords = self.coordinates
            tmp = zeros(self.extent + size * 2)
            coords = (coords - self.bbox[0:len(self.center)] + size)
            tmp[coords.T.tolist()] = 1
            tmp = binary_dilation(tmp, ones((size, size)))
            new = asarray(where(tmp)).T + self.bbox[0:len(self.center)] - size
            new = [c for c in new if all(c >= 0)]
        else:
            return self
        
        return one(new)
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
590467
def resize(self, newWidth = 0, newHeight = 0):
        
        self.height = newHeight
        self.width = newWidth
1009007
def resize_bytes(self, size):
        
        Buffer.resize_bytes(self, size)
        self._size = size // self.itemsize
496362
def resize(self, size:Union[int,TensorImageSize]) -> 'ImagePoints':
        ""
        if isinstance(size, int): size=(1, size, size)
        self._flow.size = size[1:]
        return self
773297
def new(batch_size=None, **options):
    

    if batch_size:
        new_context = AutoContext(batch_size=batch_size, **options)
    else:
        new_context = Context(**options)

    _local.get_local_context().registry.append(new_context)

    return new_context
301118
def resize_dimension(self, dimension, size):
        
        if self.dimensions[dimension] is not None:
            raise ValueError("Dimension '%s' is not unlimited and thus "
                             "cannot be resized." % dimension)

        # Resize the dimension.
        self._current_dim_sizes[dimension] = size

        for var in self.variables.values():
            new_shape = list(var.shape)
            for i, d in enumerate(var.dimensions):
                if d == dimension:
                    new_shape[i] = size
            new_shape = tuple(new_shape)
            if new_shape != var.shape:
                var._h5ds.resize(new_shape)

        # Recurse as dimensions are visible to this group and all child groups.
        for i in self.groups.values():
            i.resize_dimension(dimension, size)