`computeWindowScale` counts the scale factor between window size and size defined for the presentation in the config.
487930
function( config ) {
        var hScale = window.innerHeight / config.height,
            wScale = window.innerWidth / config.width,
            scale = hScale > wScale ? wScale : hScale;

        if ( config.maxScale && scale > config.maxScale ) {
            scale = config.maxScale;
        }

        if ( config.minScale && scale < config.minScale ) {
            scale = config.minScale;
        }

        return scale;
    }
307513
def compute(self):
        """"""
        self._compute_window_size()
        smooth = []
        residual = []

        x, y = self.x, self.y

        # step through x and y data with a window window_size wide.
        self._update_values_in_window()
        self._update_mean_in_window()
        self._update_variance_in_window()
        for i, (xi, yi) in enumerate(zip(x, y)):
            if ((i - self._neighbors_on_each_side) > 0.0 and
                    (i + self._neighbors_on_each_side) < len(x)):
                self._advance_window()
            smooth_here = self._compute_smooth_during_construction(xi)
            residual_here = self._compute_cross_validated_residual_here(xi, yi, smooth_here)
            smooth.append(smooth_here)
            residual.append(residual_here)

        self._store_unsorted_results(smooth, residual)
614382
private static int compareMagnitudeNormalized(long xs, int xscale, long ys, int yscale) {
        // assert xs!=0 && ys!=0
        int sdiff = xscale - yscale;
        if (sdiff != 0) {
            if (sdiff < 0) {
                xs = longMultiplyPowerTen(xs, -sdiff);
            } else { // sdiff > 0
                ys = longMultiplyPowerTen(ys, sdiff);
            }
        }
        if (xs != INFLATED)
            return (ys != INFLATED) ? longCompareMagnitude(xs, ys) : -1;
        else
            return 1;
    }
15343
def get_rendition_fill_size(spec, input_w, input_h, output_scale):
        

        width = input_w
        height = input_h

        scale = spec.get('scale')
        if scale:
            width = width / scale
            height = height / scale

        if spec.get('scale_min_width'):
            width = max(width, spec['spec_min_width'])

        if spec.get('scale_min_height'):
            height = max(height, spec['scale_min_height'])

        if spec.get('width'):
            width = min(width, spec['width'])
        if spec.get('max_width'):
            width = min(width, spec['max_width'])

        if spec.get('height'):
            height = min(height, spec['height'])
        if spec.get('max_height'):
            height = min(height, spec['max_height'])

        width = width * output_scale
        height = height * output_scale

        # Never scale to larger than the base rendition (but keep the output
        # aspect)
        if width > input_w:
            height = height * input_w / width
            width = input_w

        if height > input_h:
            width = width * input_h / height
            height = input_h

        # Determine the box size
        box_w = min(input_w, round(width * input_h / height))
        box_h = min(input_h, round(height * input_w / width))

        # Box offset
        box_x = round((input_w - box_w) * spec.get('fill_crop_x', 0.5))
        box_y = round((input_h - box_h) * spec.get('fill_crop_y', 0.5))

        return (round(width), round(height)), (box_x, box_y, box_x + box_w, box_y + box_h)
121486
function scale(appName, configuration, callback) {
    if (!isObject(configuration)) {
      return callback(new Error('To scale pass an object with the type as key'));
    }

    var url = format('/%s/apps/%s/scale/', deis.version, appName);
    commons.post(url, configuration, 204, callback);
  }
111057
def _sanity_check_scale(self, scale_x, scale_y):
        
        win_wd, win_ht = self.get_window_size()
        if (win_wd <= 0) or (win_ht <= 0):
            raise ImageViewError("window size undefined")

        # final sanity check on resulting output image size
        if (win_wd * scale_x < 1) or (win_ht * scale_y < 1):
            raise ValueError(
                "resulting scale (%f, %f) would result in image size of "
                "<1 in width or height" % (scale_x, scale_y))

        sx = float(win_wd) / scale_x
        sy = float(win_ht) / scale_y
        if (sx < 1.0) or (sy < 1.0):
            raise ValueError(
                "resulting scale (%f, %f) would result in pixel size "
                "approaching window size" % (scale_x, scale_y))
505356
def display(self):
        
        w, h = self.session.window_size()
        return Display(w*self.scale, h*self.scale)
999762
def rescale_by(self, scale_x, scale_y, detail):
        
        self.rescale_by_factors((scale_x, scale_y), detail)
421281
private float calculateScale(int x, int y) {
		final float centerX = getWidth() / 2f;
		final float centerY = getHeight() / 2f;
		final float maxDistance = (float) Math.sqrt(centerX * centerX + centerY * centerY);

		final float deltaX = centerX - x;
		final float deltaY = centerY - y;
		final float distance = (float) Math.sqrt(deltaX * deltaX + deltaY * deltaY);
		final float scale = 0.5f + (distance / maxDistance) * 0.5f;
		return scale;
	}
1059204
function updateCanvasSize(canvasInstance) {

    // apply scale factor for HDPI screens
    var scaleFactor = canvasInstance._HDPIscaleRatio;

    var width = canvasInstance._enqueuedSize.width,
        height = canvasInstance._enqueuedSize.height;

    canvasInstance._enqueuedSize = null;

    /** @protected @type {number} */canvasInstance._width = width;
    /** @protected @type {number} */canvasInstance._height = height;

    canvasInstance._element.width = width * scaleFactor;
    canvasInstance._element.height = height * scaleFactor;

    canvasInstance._element.style.width = width + "px";
    canvasInstance._element.style.height = height + "px";

    canvasInstance._canvasContext.scale(scaleFactor, scaleFactor);

    // non-smoothing must be re-applied when the canvas dimensions change...

    if (canvasInstance._smoothing === false) canvasInstance.setSmoothing(canvasInstance._smoothing);
}
1355960
function getPageScaleFactor() {
    const pageScaleFactor = chrome.gpuBenchmarking.pageScaleFactor;
    return pageScaleFactor ? pageScaleFactor.apply(chrome.gpuBenchmarking) : 1;
  }
1006967
def _do_scale(image, size):
  """"""
  shape = tf.cast(tf.shape(image), tf.float32)
  w_greater = tf.greater(shape[0], shape[1])
  shape = tf.cond(w_greater,
                  lambda: tf.cast([shape[0] / shape[1] * size, size], tf.int32),
                  lambda: tf.cast([size, shape[1] / shape[0] * size], tf.int32))

  return tf.image.resize_bicubic([image], shape)[0]
912356
function getWorkingSetSize(paneId) {
        var result = 0;
        _forEachPaneOrPanes(paneId, function (pane) {
            result += pane.getViewListSize();
        });
        return result;
    }
107362
public static int getInheritedScale(AbstractCalculator calc, Num value) {
        if (value.getScale() == null) {
            if (calc != null && calc.getScale() != null)
                return calc.getScale();
            else
                return Properties.DEFAULT_SCALE;
        }
        else
            return value.getScale();
    }
729657
def window_size(self, value):
        """"""
        if (value > 4 and
            value < self.parameter_maxima["window_size"] and
            value % 2):
            self._window_size = value
        else:
            raise InvalidWindowSizeError("Window size must be an odd number "
                                      "between 0 and {}.".format(
                                      self.parameter_maxima["window_size"] + 1))
        self._replace_bm()
961288
private static float computeScale(float minScale, float maxScale, float currentScale, float delta) {
		if(currentScale * delta < minScale) {
			return minScale / currentScale;
		} else if(currentScale * delta > maxScale) {
			return maxScale / currentScale;
		}

		return delta;
	}
52935
def get_window_size(window):
    
    width_value = ctypes.c_int(0)
    width = ctypes.pointer(width_value)
    height_value = ctypes.c_int(0)
    height = ctypes.pointer(height_value)
    _glfw.glfwGetWindowSize(window, width, height)
    return width_value.value, height_value.value