Enumerate a set of anchors for each aspect ratio wrt an anchor.
181992
def _ratio_enum(anchor, ratios):
        
        w, h, x_ctr, y_ctr = AnchorGenerator._whctrs(anchor)
        size = w * h
        size_ratios = size / ratios
        ws = np.round(np.sqrt(size_ratios))
        hs = np.round(ws * ratios)
        anchors = AnchorGenerator._mkanchors(ws, hs, x_ctr, y_ctr)
        return anchors
319541
function axisPositiveSideProperties(_ref2) {
    var tPos = _ref2.tPos,
        tDim = _ref2.tDim;
    // substract also anchor placeholder from the beginning
    return {
      position: tPos + tDim - anchorSize
    };
  }
825369
private static List<Dimension> getVideoResolutions(ImageFormat format) {

		if (format == null) {
			throw new IllegalArgumentException("Image format cannot be null!");
		}

		ResolutionInfo info = format.getResolutionInfo();
		ResolutionInfo.Type type = info.getType();

		switch (type) {
			case DISCRETE:
				return getResolutionsDiscrete(info);
			case STEPWISE:
				return getResolutionsStepwise(info);
			case UNSUPPORTED:
				return getResolutionsUnsupported(info);
			default:
				throw new WebcamException("Unknown resolution type " + type);
		}
	}
1218658
def _init_idxs_float(self, usr_hdrs):
        """"""
        self.idxs_float = [
            Idx for Hdr, Idx in self.hdr2idx.items() if Hdr in usr_hdrs and Hdr in self.float_hdrs]
1026784
def image_set_aspect(aspect=1.0, axes="gca"):
    
    if axes is "gca": axes = _pylab.gca()

    e = axes.get_images()[0].get_extent()
    axes.set_aspect(abs((e[1]-e[0])/(e[3]-e[2]))/aspect)
133109
def _transformBy(self, matrix, **kwargs):
        
        for contour in self.contours:
            contour.transformBy(matrix)
        for component in self.components:
            component.transformBy(matrix)
        for anchor in self.anchors:
            anchor.transformBy(matrix)
        for guideline in self.guidelines:
            guideline.transformBy(matrix)
462714
def round(self):
        
        x, y = self.anchor
        self.anchor = (normalizers.normalizeRounding(x),
                       normalizers.normalizeRounding(y))
        x, y = self.bcpIn
        self.bcpIn = (normalizers.normalizeRounding(x),
                      normalizers.normalizeRounding(y))
        x, y = self.bcpOut
        self.bcpOut = (normalizers.normalizeRounding(x),
                       normalizers.normalizeRounding(y))
256488
def find_bindmounts(self):
        """"""

        for mountpoint, (orig, fs, opts) in self.mountpoints.items():
            if 'bind' in opts and re.match(self.re_pattern, mountpoint):
                yield mountpoint
78002
def _do_anchor(self, anchor):
        
        if anchor:
            for x in anchor.split("-"):
                A, P = None, None
                if x.startswith("A") and len(self.chunks) > 0: # anchor
                    A, P = x, x.replace("A","P")
                    self._anchors[A] = self.chunks[-1]
                if x.startswith("P") and len(self.pnp) > 0:    # attachment (PNP)
                    A, P = x.replace("P","A"), x
                    self._anchors[P] = self.pnp[-1]
                if A in self._anchors and P in self._anchors and not self._anchors[P].anchor:
                    pnp = self._anchors[P]
                    pnp.anchor = self._anchors[A]
                    pnp.anchor.attachments.append(pnp)
352750
def _adjust_anchors(anchor_data, ufo, component):
    """"""

    glyph = ufo[component.baseGlyph]
    t = Transform(*component.transformation)
    for anchor in glyph.anchors:
        # only adjust if this anchor has data and the component also contains
        # the associated mark anchor (e.g. "_top" for "top")
        if anchor.name in anchor_data and any(
            a.name == "_" + anchor.name for a in glyph.anchors
        ):
            anchor_data[anchor.name] = t.transformPoint((anchor.x, anchor.y))
189674
private void anchorAtThisPositionAndScale() {
        if (DEBUG)
            Log.i("MulitTouch", "anchorAtThisPositionAndScale()");
		if (selectedObject == null)
			return;

		// Get selected object's current position and scale
		objectCanvas.getPositionAndScale(selectedObject, mCurrXform);

		// Figure out the object coords of the drag start point's screen coords.
		// All stretching should be around this point in object-coord-space.
		// Also figure out out ratio between object scale factor and multitouch
		// diameter at beginning of drag; same for angle and optional anisotropic
		// scale.
		float currScaleInv = 1.0f / (!mCurrXform.updateScale ? 1.0f : mCurrXform.scale == 0.0f ? 1.0f : mCurrXform.scale);
		extractCurrPtInfo();
		startPosX = (mCurrPtX - mCurrXform.xOff) * currScaleInv;
		startPosY = (mCurrPtY - mCurrXform.yOff) * currScaleInv;
		startScaleOverPinchDiam = mCurrXform.scale / mCurrPtDiam;
		startScaleXOverPinchWidth = mCurrXform.scaleX / mCurrPtWidth;
		startScaleYOverPinchHeight = mCurrXform.scaleY / mCurrPtHeight;
		startAngleMinusPinchAngle = mCurrXform.angle - mCurrPtAng;
	}
22522
def anchored_pairs(self, anchor):

        

        pairs = OrderedDict()

        for term in self.keys:
            score = self.get_pair(anchor, term)
            if score: pairs[term] = score

        return utils.sort_dict(pairs)
1298838
def _insertions(self, result, dimension, dimension_index):
        

        def iter_insertions():
            for anchor_idx, addend_idxs in dimension.hs_indices:
                insertion_idx = (
                    -1
                    if anchor_idx == "top"
                    else result.shape[dimension_index] - 1
                    if anchor_idx == "bottom"
                    else anchor_idx
                )
                addend_fancy_idx = tuple(
                    [slice(None) for _ in range(dimension_index)]
                    + [np.array(addend_idxs)]
                )
                yield (
                    insertion_idx,
                    np.sum(result[addend_fancy_idx], axis=dimension_index),
                )

        return [insertion for insertion in iter_insertions()]
166334
public void setAnchors(int[] anchors) {
		super.anchors = new ArrayList<Anchor>();
		if (anchors != null) {
			for (int i = 0; i < anchors.length; i++) {
				if (anchors[i] >= 0) {
					addAnchor(i, anchors[i]);
				}
			}
		}
	}
1345950
function getAnchorNodes(node) {
        var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';
        var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)
              ? [node]
              : node.querySelectorAll(SELECTOR);
        var anchors = [];
        forEach(items, function(node) {
          var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);
          if (attr && attr.length) {
            anchors.push(node);
          }
        });
        return anchors;
      }
267066
def _scale_enum(anchor, scales):
        
        w, h, x_ctr, y_ctr = AnchorGenerator._whctrs(anchor)
        ws = w * scales
        hs = h * scales
        anchors = AnchorGenerator._mkanchors(ws, hs, x_ctr, y_ctr)
        return anchors
1113869
def iter_links(self):
        
        for x in range(self.width):
            for y in range(self.height):
                for link in Links:
                    if (x, y, link) in self:
                        yield (x, y, link)