Returns the position for the original image in the sprite.
    This is suitable for use as a value to background-position.
163840
def _sprite_position(map, sprite, offset_x=None, offset_y=None):
    
    map = StringValue(map).value
    sprite_name = StringValue(sprite).value
    sprite_map = sprite_maps.get(map)
    sprite = sprite_map and sprite_map.get(sprite_name)
    if not sprite_map:
        log.error("No sprite map found: %s", map)
    elif not sprite:
        log.error("No sprite found: %s in %s", sprite_name, sprite_map['*n*'])
    if sprite:
        x = None
        if offset_x is not None and not isinstance(offset_x, NumberValue):
            x = str(offset_x)
        if x not in ('left', 'right', 'center'):
            if x:
                offset_x = None
            x = NumberValue(offset_x or 0, 'px')
            if not x or (x <= -1 or x >= 1) and x.unit != '%':
                x -= sprite[2]
        y = None
        if offset_y is not None and not isinstance(offset_y, NumberValue):
            y = str(offset_y)
        if y not in ('top', 'bottom', 'center'):
            if y:
                offset_y = None
            y = NumberValue(offset_y or 0, 'px')
            if not y or (y <= -1 or y >= 1) and y.unit != '%':
                y -= sprite[3]
        pos = '%s %s' % (x, y)
        return StringValue(pos)
    return StringValue('0 0')
508921
def update(self):
        
        returnValue = False  # typical return value
        if self.state != PygAnimation.PLAYING:
            return returnValue

        # The job here is to figure out the index of the image to show
        # and the matching elapsed time threshold for the current image
        self.elapsed = (time.time() - self.playingStartTime)

        if self.elapsed > self.elapsedStopTime:  # anim finished
            if self.loop:  # restart the animation
                self.playingStartTime = time.time()
                self.nextElapsedThreshold = self.endTimesList[0]
            else:  # not looping
                self.nIterationsLeft = self.nIterationsLeft - 1
                if self.nIterationsLeft == 0:  # done
                    self.state = PygAnimation.STOPPED
                    if self.callBack != None:  # if there is a callBack
                        self.callBack(self.nickname)  # do it
                    returnValue = True  # animation has ended
                else:  # another iteration - start over again
                    self.playingStartTime = time.time()
                    self.nextElapsedThreshold = self.endTimesList[0]
            self.index = 0

        elif self.elapsed > self.nextElapsedThreshold:
            # Time to move on to next picture
            self.index = self.index + 1
            self.nextElapsedThreshold = self.endTimesList[self.index]

        return returnValue
1230649
def _repr_png_(self):
        
        app.process_events()
        QApplication.processEvents()

        img = read_pixels()
        return bytes(_make_png(img))
415175
function getBackgroundPositionInPercent(image) {
	var x = 100 * (image.coordinates.x) / (image.properties.width - image.coordinates.width);
	var y = 100 * (image.coordinates.y) / (image.properties.height - image.coordinates.height);
	var template = _.template('<%= (x ? x + "%" : x) %> <%= (y ? y + "%" : y) %>');
	return template({x: x, y: y});
}
841791
def image(self, s=0, c=0, z=0, t=0):
        
        return self.proxy_image(s=s, c=c, z=z, t=t).image
179485
def _position():
    

    cursor = POINT()
    ctypes.windll.user32.GetCursorPos(ctypes.byref(cursor))
    return (cursor.x, cursor.y)
459259
def getPose3d(self):
        '''
        

        '''	   
        self.lock.acquire()
        pose = self.pose
        self.lock.release()
        return pose
656776
def original(self):
        
        images = self.query._original_images(**self.identity_map)
        if images:
            return images[0]
1182592
def getTopRight(self):
        
        return (float(self.get_x()) + float(self.get_width()), float(self.get_y()) + float(self.get_height()))
1278669
def image(self):
        
        uri = "/%s/image" % self.uri_base
        resp, resp_body = self.api.method_get(uri)
        return resp_body
692898
def pixel(self, coord_x, coord_y):
        # type: (int, int) -> Pixel
        

        try:
            return self.pixels[coord_y][coord_x]  # type: ignore
        except IndexError:
            raise ScreenShotError(
                "Pixel location ({}, {}) is out of range.".format(coord_x, coord_y)
            )
642337
def getImage(self):
        """"""
        value = self.__getNone(self.__dataItem['image']['url'])
        if value == None:
            return None
        else:
            return Sitools2Abstract.getBaseUrl(self) + self.__dataItem['image']['url']
251054
def _game_image_from_screen(self, game_type):
        
        # screen
        screen_img = self._screen_shot()
        # game image
        game_rect = self._game_finders[game_type].locate_in(screen_img)
        if game_rect is None:
            return
        t, l, b, r = game_rect
        game_img = screen_img[t:b, l:r]
        return game_img
283485
def _sprite(map, sprite, offset_x=None, offset_y=None):
    
    map = StringValue(map).value
    sprite_name = StringValue(sprite).value
    sprite_map = sprite_maps.get(map)
    sprite = sprite_map and sprite_map.get(sprite_name)
    if not sprite_map:
        log.error("No sprite map found: %s", map)
    elif not sprite:
        log.error("No sprite found: %s in %s", sprite_name, sprite_map['*n*'])
    if sprite:
        url = '%s%s?_=%s' % (ASSETS_URL, sprite_map['*f*'], sprite_map['*t*'])
        x = NumberValue(offset_x or 0, 'px')
        y = NumberValue(offset_y or 0, 'px')
        if not x or (x <= -1 or x >= 1) and x.unit != '%':
            x -= sprite[2]
        if not y or (y <= -1 or y >= 1) and y.unit != '%':
            y -= sprite[3]
        pos = "url(%s) %s %s" % (escape(url), x, y)
        return StringValue(pos)
    return StringValue('0 0')
1281913
def get_image(self):
        
        if self._imgobj is not None:
            # quick optomization
            return self._imgobj.get_image()

        canvas_img = self.get_canvas_image()
        return canvas_img.get_image()
386556
function (x, y) {
        var i = (y * this.size.w + x) * this.bytes;
        var res = [this.image[i], this.image[i + 1], this.image[i + 2], this.image[i + 3]];
        return res;
    }
1057572
function() {
        if (!this.imgDiv) {
            this.imgDiv = OpenLayers.Tile.Image.IMAGE.cloneNode(false);

            var style = this.imgDiv.style;
            if (this.frame) {
                var left = 0, top = 0;
                if (this.layer.gutter) {
                    left = this.layer.gutter / this.layer.tileSize.w * 100;
                    top = this.layer.gutter / this.layer.tileSize.h * 100;
                }
                style.left = -left + "%";
                style.top = -top + "%";
                style.width = (2 * left + 100) + "%";
                style.height = (2 * top + 100) + "%";
            }
            style.visibility = "hidden";
            style.opacity = 0;
            if (this.layer.opacity < 1) {
                style.filter = 'alpha(opacity=' +
                               (this.layer.opacity * 100) +
                               ')';
            }
            style.position = "absolute";
            if (this.layerAlphaHack) {
                // move the image out of sight
                style.paddingTop = style.height;
                style.height = "0";
                style.width = "100%";
            }
            if (this.frame) {
                this.frame.appendChild(this.imgDiv);
            }
        }

        return this.imgDiv;
    }