Updates shape in code_array
165172
def _pys2shape(self, line):
        """"""

        self.code_array.shape = self._get_key(*self._split_tidy(line))
200188
def _update(self):
        

        if self._vertices_buffer is not None:
            self._vertices_buffer.delete()
        self._vertices_buffer = VertexBuffer(self._vertices_list.data)

        if self.itype is not None:
            if self._indices_buffer is not None:
                self._indices_buffer.delete()
            self._indices_buffer = IndexBuffer(self._indices_list.data)

        if self.utype is not None:
            if self._uniforms_texture is not None:
                self._uniforms_texture.delete()

            # We take the whole array (_data), not the data one
            texture = self._uniforms_list._data.view(np.float32)
            size = len(texture) / self._uniforms_float_count
            shape = self._compute_texture_shape(size)

            # shape[2] = float count is only used in vertex shader code
            texture = texture.reshape(shape[0], shape[1], 4)
            self._uniforms_texture = Texture2D(texture)
            self._uniforms_texture.data = texture
            self._uniforms_texture.interpolation = 'nearest'

        if len(self._programs):
            for program in self._programs:
                program.bind(self._vertices_buffer)
                if self._uniforms_list is not None:
                    program["uniforms"] = self._uniforms_texture
                    program["uniforms_shape"] = self._ushape
722713
def _op_shape(self, other):
        """"""
        if isinstance(other, farray):
            if self.shape == other.shape:
                return self.shape
            elif self.size == other.size:
                return None
            else:
                raise ValueError("expected operand sizes to match")
        else:
            raise TypeError("expected farray input")
1268808
def out_shape_from_array(arr):
    """"""
    arr = np.asarray(arr)
    if arr.ndim == 1:
        return arr.shape
    else:
        return (arr.shape[1],)
1286596
private void addShape(String data)
	{
		if (faces.size() != 0)
		{
			Shape s = new Shape(faces);
			shapes.put(currentShape.toLowerCase(), s);
			faces.clear();
		}

		if (data != "")
			currentShape = data.indexOf('_') != -1 ? data.substring(0, data.indexOf('_')) : data;
	}
1243120
def _shape2pys(self):
        

        shape_line = u"\t".join(map(unicode, self.code_array.shape)) + u"\n"
        self.pys_file.write(shape_line)
819473
def set_shape(self, id, new_shape):
        """"""
        old_shape = self.id_to_shape[id]
        old_buffer = self.get_buffer(old_shape)
        model, color = old_buffer.get(id)
        new_data = self._create_turtle(id, new_shape, model, color)
        old_buffer.remove(id)
        self.id_to_shape[id] = new_shape
        return new_data
414742
def fill_array(self, array, field, add=False, maximize=False):
        
        self.fix_shapes()
        for i in xrange(self.n_chunks):
            for side in ['left', 'right', 'top', 'bottom']:
                edge = getattr(self, side).ravel()[i]
                if add:
                    array[edge.slice] += getattr(edge, field)
                elif maximize:
                    array[edge.slice] = np.maximum(array[edge.slice],
                                                   getattr(edge, field))
                else:
                    array[edge.slice] = getattr(edge, field)
        return array
1125604
def _xls2shape(self):
        """"""

        sheets = self.workbook.sheets()
        nrows = 1
        ncols = 1
        for sheet in sheets:
            nrows = max(nrows, sheet.nrows)
            ncols = max(ncols, sheet.ncols)
        ntabs = len(sheets)

        self.code_array.shape = nrows, ncols, ntabs
608087
function removeShape(shape) {
         me.utils.array.remove(this.shapes, shape); // update the body bounds to take in account the removed shape

         this.updateBounds(); // return the length of the shape list

         return this.shapes.length;
       }
365714
def crc_update(crc, data):
    
    if type(data) != array.array or data.itemsize != 1:
        buf = array.array("B", data)
    else:
        buf = data
    crc = crc ^ _MASK
    for b in buf:
        table_index = (crc ^ b) & 0xff
        crc = (CRC_TABLE[table_index] ^ (crc >> 8)) & _MASK
    return crc ^ _MASK
556610
def fix_shapes(self):
        
        for i in xrange(self.n_chunks):
            for side in ['left', 'right', 'top', 'bottom']:
                edge = getattr(self, side).ravel()[i]
                if side in ['left', 'right']:
                    shp = [edge.todo.size, 1]
                else:
                    shp = [1, edge.todo.size]
                edge.done = edge.done.reshape(shp)
                edge.data = edge.data.reshape(shp)
                edge.todo = edge.todo.reshape(shp)
740916
def update(self):
        
        pixels = len(self.matrix)
        for x in range(self.width):
            for y in range(self.height):
                pixel = y * self.width * 3 + x * 3
                #TODO: sometimes the matrix is not as big as it should
                if pixel < pixels:
                    pygame.draw.circle(self.screen,
                                       (self.matrix[pixel], self.matrix[pixel + 1], self.matrix[pixel + 2]),
                                       (x * self.dotsize + self.dotsize / 2, y * self.dotsize + self.dotsize / 2), self.dotsize / 2, 0)
804035
def updateState(self, slicedArray, rtiInfo, separateFields):
        
        self.beginResetModel()
        try:
            # The sliced array can be a masked array or a (regular) numpy array.
            # The table works fine with masked arrays, no need to replace the masked values.
            self._slicedArray = slicedArray
            if slicedArray is None:
                self._nRows = 0
                self._nCols = 0
                self._fieldNames = []
            else:
                self._nRows, self._nCols = self._slicedArray.shape
                if self._slicedArray.data.dtype.names:
                    self._fieldNames = self._slicedArray.data.dtype.names
                else:
                    self._fieldNames = []

            self._rtiInfo = rtiInfo
            self._separateFields = separateFields

            # Don't put numbers in the header if the record is of structured type, fields are
            # placed in separate cells and the fake dimension is selected (combo index 0)
            if self._separateFields and self._fieldNames:

                if self._rtiInfo['x-dim'] == FAKE_DIM_NAME:
                    self._separateFieldOrientation = Qt.Horizontal
                    self._numbersInHeader = False
                elif self._rtiInfo['y-dim'] == FAKE_DIM_NAME:
                    self._separateFieldOrientation = Qt.Vertical
                    self._numbersInHeader = False
                else:
                    self._separateFieldOrientation = Qt.Horizontal
                    self._numbersInHeader = True
            else:
                self._separateFieldOrientation = None
                self._numbersInHeader = True

        finally:
            self.endResetModel()
36830
def update(self, newcfg):
        """"""
        for key in newcfg.keys():
            if key not in self._cfg:
                self._cfg[key] = CaseInsensitiveDict()
            for skey in newcfg[key]:
                self._cfg[key][skey] = newcfg[key][skey]
708235
def update(self):
        ""              
        # get new shape and clear for attrs
        self.edges = np.zeros((self.ttree.nnodes - 1, 2), dtype=int)
        self.verts = np.zeros((self.ttree.nnodes, 2), dtype=float)
        self.lines = []
        self.coords = []

        # fill with updates
        self.update_idxs()             # get dimensions of tree
        self.update_fixed_order()      # in case ntips changed
        self.assign_vertices()         # get node locations
        self.assign_coordinates()      # get edge locations
        self.reorient_coordinates()
731415
function arrayUpdate(mutate, at, v, arr) {
    var out = arr;
    if (!mutate) {
        var len = arr.length;
        out = new Array(len);
        for (var i = 0; i < len; ++i) {
            out[i] = arr[i];
        }
    }
    out[at] = v;
    return out;
}