Add scale 'sc' and remove any previous
        scales that cover the same aesthetics
11514
def append(self, sc):
        
        ae = sc.aesthetics[0]
        cover_ae = self.find(ae)
        if any(cover_ae):
            warn(_TPL_DUPLICATE_SCALE.format(ae), PlotnineWarning)
            idx = cover_ae.index(True)
            self.pop(idx)
        # super() does not work well with reloads
        list.append(self, sc)
971810
function scale(progress) {
  var to = (this.options.to !== undefined) ? this.options.to : 1;
  var from = (this.options.from !== undefined) ? this.options.from : this.transforms.scale[0];
  var scale = (to - from) * progress + from;

  this.transforms.scale[0] = scale;
  this.transforms.scale[1] = scale;
}
1139270
def _attach_dim_scales(self):
        """"""
        for name, var in self.variables.items():
            if name not in self.dimensions:
                for n, dim in enumerate(var.dimensions):
                    var._h5ds.dims[n].attach_scale(self._all_h5groups[dim])

        for subgroup in self.groups.values():
            subgroup._attach_dim_scales()
326941
def _squish(scale:uniform=1.0, row_pct:uniform=0.5, col_pct:uniform=0.5):
    ""
    if scale <= 1:
        col_c = (1-scale) * (2*col_pct - 1)
        return _get_zoom_mat(scale, 1, col_c, 0.)
    else:
        row_c = (1-1/scale) * (2*row_pct - 1)
        return _get_zoom_mat(1, 1/scale, 0., row_c)
163850
def remove_chartjunk(ax, spines, grid=None, ticklabels=None, show_ticks=False,
                     xkcd=False):
    '''
    
    '''
    all_spines = ['top', 'bottom', 'right', 'left', 'polar']
    for spine in spines:
        # The try/except is for polar coordinates, which only have a 'polar'
        # spine and none of the others
        try:
            ax.spines[spine].set_visible(False)
        except KeyError:
            pass

    # For the remaining spines, make their line thinner and a slightly
    # off-black dark grey
    if not xkcd:
        for spine in set(all_spines).difference(set(spines)):
            # The try/except is for polar coordinates, which only have a
            # 'polar' spine and none of the others
            try:
                ax.spines[spine].set_linewidth(0.5)
            except KeyError:
                pass
                # ax.spines[spine].set_color(almost_black)
                # ax.spines[spine].set_tick_params(color=almost_black)
                # Check that the axes are not log-scale. If they are, leave
                # the ticks because otherwise people assume a linear scale.
    x_pos = set(['top', 'bottom'])
    y_pos = set(['left', 'right'])
    xy_pos = [x_pos, y_pos]
    xy_ax_names = ['xaxis', 'yaxis']

    for ax_name, pos in zip(xy_ax_names, xy_pos):
        axis = ax.__dict__[ax_name]
        # axis.set_tick_params(color=almost_black)
        #print 'axis.get_scale()', axis.get_scale()
        if show_ticks or axis.get_scale() == 'log':
            # if this spine is not in the list of spines to remove
            for p in pos.difference(spines):
                #print 'p', p
                axis.set_tick_params(direction='out')
                axis.set_ticks_position(p)
                #                axis.set_tick_params(which='both', p)
        else:
            axis.set_ticks_position('none')

    if grid is not None:
        for g in grid:
            assert g in ('x', 'y')
            ax.grid(axis=grid, color='white', linestyle='-', linewidth=0.5)

    if ticklabels is not None:
        if type(ticklabels) is str:
            assert ticklabels in set(('x', 'y'))
            if ticklabels == 'x':
                ax.set_xticklabels([])
            if ticklabels == 'y':
                ax.set_yticklabels([])
        else:
            assert set(ticklabels) | set(('x', 'y')) > 0
            if 'x' in ticklabels:
                ax.set_xticklabels([])
            elif 'y' in ticklabels:
                ax.set_yticklabels([])
1226933
def set_initial(self, C_in, scale_in, scale_high):
        """
        self.C_in = C_in
        self.scale_in = scale_in
        self.scale_high = scale_high
1230733
protected void revalidateLayout() {
        for (MaterialIcon icon : iconList) {
            icon.removeFromParent();
        }
        iconList.clear();

        // same mouse-out handler for all icons
        MouseOutHandler outHandler = event -> {
            if (!isEnabled() || !isEditable()) {
                return;
            }
            revalidateSelection(currentRating);
        };

        for (int i = 0; i < maxRating; i++) {
            final int rating = i + 1;
            MaterialIcon icon = new MaterialIcon(unselectedRatingIcon);
            registerHandler(icon.addClickHandler(event -> {
                if (!isEnabled() || !isEditable()) {
                    return;
                }
                setValue(rating, true);
            }));

            registerHandler(icon.addMouseOverHandler(event -> {
                if (!isEnabled() || !isEditable()) {
                    return;
                }
                revalidateSelection(rating);
            }));

            registerHandler(icon.addMouseOutHandler(outHandler));
            add(icon);
            iconList.add(icon);
        }
        revalidateSelection(currentRating);
    }
1095563
def to_(self, off_pts):
        """"""
        off_pts = np.asarray(off_pts, dtype=np.float)
        has_z = (off_pts.shape[-1] > 2)

        # scale according to current settings
        scale_pt = [self.viewer._org_scale_x, self.viewer._org_scale_y]
        if has_z:
            scale_pt.append(self.viewer._org_scale_z)

        off_pts = np.multiply(off_pts, scale_pt)
        return off_pts
788022
def apply_scale(self, scale):
        
        dimension = self.vertices.shape[1]
        matrix = np.eye(dimension + 1)
        matrix[:dimension, :dimension] *= scale
        self.apply_transform(matrix)
612046
public void scale(double scaleX, double scaleY) {
		this.m00 *= scaleX;
		this.m11 *= scaleY;
		this.m01 *= scaleY;
		this.m10 *= scaleX;
	}
688634
def scaled(self, sx, sy=None, origin=0j):
        """"""
        return scale(self, sx=sx, sy=sy, origin=origin)
250209
def scale_transform(t, scale):
    
    if isinstance(scale, float) or isinstance(scale, int):
        scale = [scale, scale, scale]

    if _is_indexable(t[0]):
        return [[t[0][0] * scale[0], t[0][1] * scale[1], t[0][2] * scale[2]],
                t[1]]
    else:
        return [t[0] * scale[0], t[1] * scale[1], t[2] * scale[2]]
299654
def remake_display(self, *args):
        
        Builder.load_string(self.kv)
        if hasattr(self, '_kv_layout'):
            self.remove_widget(self._kv_layout)
            del self._kv_layout
        self._kv_layout = KvLayout()
        self.add_widget(self._kv_layout)
635515
public void scale(float sx, float sy) {
		this.sx = this.sx * sx;
		this.sy = this.sy * sy;
		
		checkPush();

		predraw();
		GL.glScalef(sx, sy, 1);
		postdraw();
	}
773781
@Api
	public void setScales(Double... scales) {
		// Sort decreasing and store the list:
		Arrays.sort(scales, Collections.reverseOrder());
		scaleList = Arrays.asList(scales);
		// Apply the requested scales on the SelectItem. Make sure only available scales are added:
		updateScaleList();
	}
1374545
def _set_scale(self, value):
        
        sx, sxy, syx, sy, ox, oy = self.transformation
        sx, sy = value
        self.transformation = (sx, sxy, syx, sy, ox, oy)
1184497
function (b, s) {
        vec3.scaleAndAdd(this.array, this.array, b.array, s);
        this._dirty = true;
        return this;
    }