Inverts the currently selected items in the scene.
760403
def selectInvert( self ):
        
        currLayer = self._currentLayer
        for item in self.items():
            layer = item.layer()
            if ( layer == currLayer or not layer ):
                item.setSelected(not item.isSelected())
281546
def flip(self):
        '''
        
        '''
        tmp = self.A.xyz
        self.A = self.B
        self.B = tmp
405774
function inverted(node) {
  if (node.value === threeDashes) {
    node.value = enDash
  } else if (node.value === twoDashes) {
    node.value = emDash
  }
}
430558
def _reverse(self):
    
    for p in self.items:
      for h in p.hunks:
        h.startsrc, h.starttgt = h.starttgt, h.startsrc
        h.linessrc, h.linestgt = h.linestgt, h.linessrc
        for i,line in enumerate(h.text):
          # need to use line[0:1] here, because line[0]
          # returns int instead of bytes on Python 3
          if line[0:1] == b'+':
            h.text[i] = b'-' + line[1:]
          elif line[0:1] == b'-':
            h.text[i] = b'+' +line[1:]
649275
def invert_pixel_mask(mask):
    '''
    '''
    inverted_mask = np.ones(shape=(80, 336), dtype=np.dtype('>u1'))
    inverted_mask[mask >= 1] = 0
    return inverted_mask
804084
def reverse_color(moves)
      moves.each do |move|
        if move["move"] && move["move"]["color"]
          move["move"]["color"] = (move["move"]["color"] + 1) % 2
        end
        move["forks"].each { |_fork| reverse_color(_fork) } if move["forks"]
      end
    end
1349633
private static void flipAround(SceneStructureMetric structure, SceneObservations observations) {
		// The first view will be identity
		for (int i = 1; i < structure.views.length; i++) {
			Se3_F64 w2v = structure.views[i].worldToView;
			w2v.set(w2v.invert(null));
		}
		triangulatePoints(structure,observations);
	}
326435
def display_current(self):
        """"""
        if self.idx_current in self.scene.items():
            self.scene.removeItem(self.idx_current)

        item = QGraphicsRectItem(0,
                                 CURR['pos0'],
                                 self.parent.value('window_length'),
                                 CURR['pos1'])
        # it's necessary to create rect first, and then move it
        item.setPos(self.parent.value('window_start'), 0)
        item.setPen(QPen(Qt.lightGray))
        item.setBrush(QBrush(Qt.lightGray))
        item.setZValue(-10)
        self.scene.addItem(item)
        self.idx_current = item
741915
def invert_permutation(permutation):
    
    return tuple([permutation.index(p) for p in range(len(permutation))])
663757
function() {
    if (!this.selection.prevSelection) return;
      
    var prevSelection = this.selection.prevSelection,
      lw = 1,
      plotOffset = this.plotOffset,
      x = Math.min(prevSelection.first.x, prevSelection.second.x),
      y = Math.min(prevSelection.first.y, prevSelection.second.y),
      w = Math.abs(prevSelection.second.x - prevSelection.first.x),
      h = Math.abs(prevSelection.second.y - prevSelection.first.y);
    
    this.octx.clearRect(x + plotOffset.left - lw + 0.5,
                        y + plotOffset.top - lw,
                        w + 2 * lw + 0.5,
                        h + 2 * lw + 0.5);
    
    this.selection.prevSelection = null;
  }
561839
function Invert()
    {
        $this->r = 0xff - $this->r;
        $this->g = 0xff - $this->g;
        $this->b = 0xff - $this->b;
    }
166805
public final void inverse() {
		double norm;  

		norm = 1f/(this.w*this.w + this.x*this.x + this.y*this.y + this.z*this.z);
		this.w *=  norm;
		this.x *= -norm;
		this.y *= -norm;
		this.z *= -norm;
	}
507033
public void setOriginToCurrent() {
		IT currToWorld = (IT)worldToCurr.invert(null);
		IT oldWorldToNewWorld = (IT) worldToInit.concat(currToWorld,null);

		PixelTransform<Point2D_F32> newToOld = converter.convertPixel(oldWorldToNewWorld,null);

		// fill in the background color
		GImageMiscOps.fill(workImage, 0);
		// render the transform
		distorter.setModel(newToOld);
		distorter.apply(stitchedImage, workImage);

		// swap the two images
		I s = workImage;
		workImage = stitchedImage;
		stitchedImage = s;

		// have motion estimates be relative to this frame
		motion.setToFirst();
		first = true;

		computeCurrToInit_PixelTran();
	}
1354069
function _rotateSelection(distance) {
            var len = Math.min(self.hints.length, self.maxResults),
                pos;

            if (self.selectedIndex < 0) {
                // set the initial selection
                pos = (distance > 0) ? distance - 1 : len - 1;

            } else {
                // adjust current selection
                pos = self.selectedIndex;

                // Don't "rotate" until all items have been shown
                if (distance > 0) {
                    if (pos === (len - 1)) {
                        pos = 0;  // wrap
                    } else {
                        pos = Math.min(pos + distance, len - 1);
                    }
                } else {
                    if (pos === 0) {
                        pos = (len - 1);  // wrap
                    } else {
                        pos = Math.max(pos + distance, 0);
                    }
                }
            }

            self._setSelectedIndex(pos);
        }
1024503
def _select_options(self, options, keys, invert=False):
        
        options = self._merge_options(options)
        result = {}
        for key in options:
            if (invert and key not in keys) or (not invert and key in keys):
                result[key] = options[key]
        return result
877095
protected void convert ()
    {
        if (_image == null) {
            return;
        }

        // obtain the target color and offset
        try {
            BufferedImage image;
            if (_tabs.getSelectedIndex() == 0) {
                // All recolorings from file.
                image = getAllRecolors(_labelColors.isSelected());
                if (image == null) {
                    return;
                }
            } else if (_tabs.getSelectedIndex() == 1) {
                ArrayList<Colorization> zations = Lists.newArrayList();
                if (_classList1.getSelectedItem() != NONE) {
                    zations.add(_colRepo.getColorization((String)_classList1.getSelectedItem(),
                        (String)_colorList1.getSelectedItem()));
                }
                if (_classList2.getSelectedItem() != NONE) {
                    zations.add(_colRepo.getColorization((String)_classList2.getSelectedItem(),
                        (String)_colorList2.getSelectedItem()));
                }
                if (_classList3.getSelectedItem() != NONE) {
                    zations.add(_colRepo.getColorization((String)_classList3.getSelectedItem(),
                        (String)_colorList3.getSelectedItem()));
                }
                if (_classList4.getSelectedItem() != NONE) {
                    zations.add(_colRepo.getColorization((String)_classList4.getSelectedItem(),
                        (String)_colorList4.getSelectedItem()));
                }

                image = ImageUtil.recolorImage(_image,
                    zations.toArray(new Colorization[zations.size()]));
            } else {
                // Manual recoloring
                int color = Integer.parseInt(_source.getText(), 16);

                float hueD = _hueD.getValue();
                float satD = _saturationD.getValue();
                float valD = _valueD.getValue();
                float[] dists = new float[] { hueD, satD, valD };

                float hueO = _hueO.getValue();
                float satO = _saturationO.getValue();
                float valO = _valueO.getValue();
                float[] offsets = new float[] { hueO, satO, valO };

                image = ImageUtil.recolorImage(_image, new Color(color), dists, offsets);
            }
            _newImage.setIcon(new ImageIcon(image));
            _status.setText("Recolored image.");
            repaint();

        } catch (NumberFormatException nfe) {
            _status.setText("Invalid value: " + nfe.getMessage());
        }
    }
420962
def shift_display(self, amount):
        """"""
        if amount == 0:
            return
        direction = c.LCD_MOVERIGHT if amount > 0 else c.LCD_MOVELEFT
        for i in range(abs(amount)):
            self.command(c.LCD_CURSORSHIFT | c.LCD_DISPLAYMOVE | direction)
            c.usleep(50)