Only flip boxes coordinates, images will be flipped when loading into network
555637
def append_flipped_images(self):
        """"""
        logger.info('%s append flipped images to roidb' % self._name)
        roidb_flipped = []
        for roi_rec in self._roidb:
            boxes = roi_rec['boxes'].copy()
            oldx1 = boxes[:, 0].copy()
            oldx2 = boxes[:, 2].copy()
            boxes[:, 0] = roi_rec['width'] - oldx2 - 1
            boxes[:, 2] = roi_rec['width'] - oldx1 - 1
            assert (boxes[:, 2] >= boxes[:, 0]).all()
            roi_rec_flipped = roi_rec.copy()
            roi_rec_flipped['boxes'] = boxes
            roi_rec_flipped['flipped'] = True
            roidb_flipped.append(roi_rec_flipped)
        self._roidb.extend(roidb_flipped)
88539
def flip(self, axis=0, preserve_centroid=False):
        '''
        

        '''
        self.v[:, axis] *= -1

        if preserve_centroid:
            self.v[:, axis] -= 2 * self.centroid[0]

        self.flip_faces()
357238
def flip(self, n_windows):
        

        assert n_windows >= 0
        self.page_index += (self.step * n_windows)
        self.cursor_index = n_windows
        self.inverted = not self.inverted
        self.top_item_height = None
321937
function readImageLayer(map, data, z) {
        // Normalize properties
        me.TMXUtils.applyTMXProperties(data.properties, data);

        // create the layer
        var imageLayer = me.pool.pull("me.ImageLayer",
            // x/y is deprecated since 0.15 and replace by offsetx/y
            +data.offsetx || +data.x || 0,
            +data.offsety || +data.y || 0,
            Object.assign({
                name: data.name,
                image: data.image,
                z: z
            }, data.properties)
        );

        // set some additional flags
        var visible = typeof(data.visible) !== "undefined" ? data.visible : true;
        imageLayer.setOpacity(visible ? +data.opacity : 0);

        return imageLayer;
    }
720806
def reset_coord(self):
        
        (x, y, idx) = self.world2pix(self.init_skycoord.ra,
                                     self.init_skycoord.dec,
                                     usepv=True)
        self.update_pixel_location((x, y), idx)
1200158
def flipsign(U):
    
    midx = abs(U).argmax(axis=0)
    for i in range(U.shape[1]):
        if U[midx[i], i] < 0:
            U[:, i] = -U[:, i]
    return U
964659
def exif_orientation(im):
    
    try:
        exif = im._getexif()
    except Exception:
        # There are many ways that _getexif fails, we're just going to blanket
        # cover them all.
        exif = None
    if exif:
        orientation = exif.get(0x0112)
        if orientation == 2:
            im = im.transpose(Image.FLIP_LEFT_RIGHT)
        elif orientation == 3:
            im = im.transpose(Image.ROTATE_180)
        elif orientation == 4:
            im = im.transpose(Image.FLIP_TOP_BOTTOM)
        elif orientation == 5:
            im = im.transpose(Image.ROTATE_270).transpose(Image.FLIP_LEFT_RIGHT)
        elif orientation == 6:
            im = im.transpose(Image.ROTATE_270)
        elif orientation == 7:
            im = im.transpose(Image.ROTATE_90).transpose(Image.FLIP_LEFT_RIGHT)
        elif orientation == 8:
            im = im.transpose(Image.ROTATE_90)
    return im
1219744
public static void getImagePosition(State state, Settings settings, Rect out) {
        state.get(tmpMatrix);
        getImagePosition(tmpMatrix, settings, out);
    }
1109027
function loadStandsData()
        {
            $array = $fields = array();
            $i = 0;
            $handle = @fopen($this->airportStandsFile, "r");
            if ($handle) {
                while (($row = fgetcsv($handle, 4096)) !== false) {
                    if (empty($fields)) {
                        $fields = $row;
                        continue;
                    }
                    $y = 0;
                    foreach ($row as $k => $value) {
                        if ($y == 1) { // Convert LAT coordinate
                            $array[$row[0]][$fields[$k]] = $this->convertCAALatCoord($value);
                        } else if ($y == 2) { // Convert LONG coordinate
                            $array[$row[0]][$fields[$k]] = $this->convertCAALongCoord($value);
                        } else {
                            $array[$row[0]][$fields[$k]] = $value;
                        }
                        $y++;
                    }
                    $i++;
                }
                if (!feof($handle)) {
                    echo "Error: unexpected fgets() fail\n";
                    return false;
                }
                fclose($handle);
            } else {
                return false;
            }
            $this->stands = $array;
            return true;
        }
391052
def transpose_image(self, image):
        
        EXIF_ORIENTATION_STEPS = {
            1: [],
            2: ['FLIP_LEFT_RIGHT'],
            3: ['ROTATE_180'],
            4: ['FLIP_TOP_BOTTOM'],
            5: ['ROTATE_270', 'FLIP_LEFT_RIGHT'],
            6: ['ROTATE_270'],
            7: ['ROTATE_90', 'FLIP_LEFT_RIGHT'],
            8: ['ROTATE_90'],
        }
        try:
            orientation = image._getexif()[0x0112]
            ops = EXIF_ORIENTATION_STEPS[orientation]
        except:
            ops = []
        for method in ops:
            image = image.transpose(getattr(Image, method))
        return image
1205760
def pix2ang(nside, ipix, nest=False, lonlat=False):
    """"""
    lon, lat = healpix_to_lonlat(ipix, nside, order='nested' if nest else 'ring')
    return _lonlat_to_healpy(lon, lat, lonlat=lonlat)
23786
public function flip($flip_horizontal, $flip_vertical = false)
	{
		if (empty($this->resource))
		{
			return false;
		}
		$resource = $this->resource;
		$width = imagesx($resource);
		$height = imagesy($resource);
		$new_resource = imagecreatetruecolor($width, $height);

		for ($x=0; $x<$width; $x++)
		{
			for ($y=0; $y<$height; $y++)
			{
				if ($flip_horizontal && $flip_vertical)
				{
					imagecopy($new_resource, $resource, $width-$x-1, $height-$y-1, $x, $y, 1, 1);
				}
				else if ($flip_horizontal)
				{
					imagecopy($new_resource, $resource, $width-$x-1, $y, $x, $y, 1, 1);
				}
				else if ($flip_vertical)
				{
					imagecopy($new_resource, $resource, $x, $height-$y-1, $x, $y, 1, 1);
				}
			}
		}

		$this->resource = $new_resource;
		imagedestroy($resource);
	}
686459
def flip(self):
        
        self._load()
        groups = self.config.keys()
        tabular = {}
        for g in groups:
            config = self.config[g]
            for k in config:
                r = tabular.get(k, {})
                r[g] = config[k]
                tabular[k] = r
        return tabular
792925
function flipShadow(value) {
  var elements = value.split(/\s+/);

  if (!elements) { return value; }

  var inset = (elements[0] == 'inset') ? elements.shift() + ' ' : '';
  var property = elements[0].match(/^([-+]?\d+)(\w*)$/);

  if (!property) { return value; }

  return inset + [(-1 * +property[1]) + property[2]]
      .concat(elements.splice(1)).join(' ');
}
260116
def pixels_to_ndc(pos, size=None):
    """"""
    pos = np.asarray(pos, dtype=np.float64)
    size = np.asarray(size, dtype=np.float64)
    pos = pos / (size / 2.) - 1
    # Flip y, because the origin in pixels is at the top left corner of the
    # window.
    pos[1] = -pos[1]
    return pos
778370
function fillRotatedRect(ctx, x, y, width, height, angle) {
  // Get the origin of the rectangle around its center
  var originX = width / 2;
  var originY = height / 2;

  // Save the unrotated context of the canvas so we can restore it later
  ctx.save();

  // Rotate the around the origin, given the specified offset
  ctx.translate(x + originX, y + originY);
  ctx.rotate(angle);

  // After transforming, (0,0) is visually (-originX,-originY), so the box
  // needs to be offset accordingly
  ctx.fillRect(-originX, -originY, width, height);

   // We're done with the rotating, so restore to the unrotated context
  ctx.restore();
}
876323
function() {
        if (!this.url && !this.imgDiv) {
            // fast path out - if there is no tile url and no previous image
            this.isLoading = false;
            return;
        }
        this.events.triggerEvent('beforeload');
        this.layer.div.appendChild(this.getTile());
        this.events.triggerEvent(this._loadEvent);
        var img = this.getImage();
        var src = img.getAttribute('src') || '';
        if (this.url && OpenLayers.Util.isEquivalentUrl(src, this.url)) {
            this._loadTimeout = window.setTimeout(
                OpenLayers.Function.bind(this.onImageLoad, this), 0
            );
        } else {
            this.stopLoading();
            if (this.crossOriginKeyword) {
                img.removeAttribute("crossorigin");
            }
            OpenLayers.Event.observe(img, "load",
                OpenLayers.Function.bind(this.onImageLoad, this)
            );
            OpenLayers.Event.observe(img, "error",
                OpenLayers.Function.bind(this.onImageError, this)
            );
            this.imageReloadAttempts = 0;
            this.setImgSrc(this.url);
        }
    }