Given dt in [0, 1], return the current position of the tile.
548403
def get_position(self, dt):
        """"""
        return self.sx + self.dx * dt, self.sy + self.dy * dt
312840
def __move(self, current_pos):
        '''
        
        '''
        if self.__move_range is not None:
            next_pos = np.random.randint(current_pos - self.__move_range, current_pos + self.__move_range)
            if next_pos < 0:
                next_pos = 0
            elif next_pos >= self.var_arr.shape[0] - 1:
                next_pos = self.var_arr.shape[0] - 1
            return next_pos
        else:
            next_pos = np.random.randint(self.var_arr.shape[0] - 1)
            return next_pos
55773
function getDirectionPositionForRange (value, min, max, orientation) {
  return isVertical(orientation) ? (
    // as upper value is used to calculate `top`;
    Math.round(((max - value[1]) / max - min) * 100)
  ) : (
    Math.round((value[0] / max - min) * 100)
  );
}
761820
public static long getTileColumn(BoundingBox totalBox, long matrixWidth,
			double longitude) {

		double minX = totalBox.getMinLongitude();
		double maxX = totalBox.getMaxLongitude();

		long tileId;
		if (longitude < minX) {
			tileId = -1;
		} else if (longitude >= maxX) {
			tileId = matrixWidth;
		} else {
			double matrixWidthMeters = totalBox.getMaxLongitude()
					- totalBox.getMinLongitude();
			double tileWidth = matrixWidthMeters / matrixWidth;
			tileId = (long) ((longitude - minX) / tileWidth);
		}

		return tileId;
	}
205248
def getPercentBlank(self):
        ''''''
        blank = 0
        nonblank = 0
        for x in self.data.flat:
            if x == -99999.0:
                blank = blank + 1
            else:
                nonblank = nonblank + 1

        print ("Blank tiles =  ", blank, "out of ", (nonblank+blank))
905474
def move_back(self, dt):
        
        self._position = self._old_position
        self.rect.topleft = self._position
        self.feet.midbottom = self.rect.midbottom
2494
def get_tile_image(self, x, y, l):
        
        # disabled for now, re-enable when support for generic maps is restored
        # # since the tile has been queried, assume it wants to be checked
        # # for animations sometime in the future
        # if self._animation_queue:
        #     self._tracked_tiles.add((x, y, l))

        try:
            # animated, so return the correct frame
            return self._animated_tile[(x, y, l)]

        except KeyError:

            # not animated, so return surface from data, if any
            return self._get_tile_image(x, y, l)
1210985
def aboveAt(self, offset=0):
        
        return Location(self.getX() + (self.getW() / 2), self.getY() + offset)
1183865
def coord_to_tile(self, lat, lon, zoom):
		''''''
		world_tiles = 1<<zoom
		x = world_tiles / 360.0 * (lon + 180.0)
		tiles_pre_radian = world_tiles / (2 * math.pi)
		e = math.sin(lat * (1/180.*math.pi))
		y = world_tiles/2 + 0.5*math.log((1+e)/(1-e)) * (-tiles_pre_radian)
		offsetx = int((x - int(x)) * TILES_WIDTH)
		offsety = int((y - int(y)) * TILES_HEIGHT)
		return TileInfo((int(x) % world_tiles, int(y) % world_tiles), zoom, self.service, offset=(offsetx, offsety))
752975
def p_current_col(self):
        ""
        prefix = self.input[:self.pos]
        nlidx = prefix.rfind('\n')
        if nlidx == -1:
            return self.pos
        return self.pos - nlidx
704790
def _get_item_position(self, idx):
        """"""
        start = 0 if idx == 0 else self._index[idx - 1] + 1
        end = self._index[idx]
        return start, end
915041
def find(self, pattern):
		
		pos = self.current_segment.data.find(pattern)
		if pos == -1:
			return -1
		return pos + self.current_position
369450
function(tile) {
    var x = tile.x;
    var y = tile.y;
    var xUp = x + 1 < xUpperBound;
    var xDown = x >= 0;
    var yUp = y + 1 < yUpperBound;
    var yDown = y >= 0;

    var adjacents = [];
    if (xUp) {
      adjacents.push({x: x + 1, y: y});
      if (yUp) {
        adjacents.push({x: x + 1, y: y + 1});
      }
      if (yDown) {
        adjacents.push({x: x + 1, y: y - 1});
      }
    }
    if (xDown) {
      adjacents.push({x: x - 1, y: y});
      if (yUp) {
        adjacents.push({x: x - 1, y: y + 1});
      }
      if (yDown) {
        adjacents.push({x: x - 1, y: y - 1});
      }
    }
    if (yUp) {
      adjacents.push({x: x, y: y + 1});
    }
    if (yDown) {
      adjacents.push({x: x, y: y - 1});
    }
    return adjacents;
  }
656749
def get(self):
        """"""
        elapsed = datetime.now() - self._previous
        self._previous += elapsed
        return elapsed.total_seconds()
678352
public Rectangle getPositionRelativeToTile(Tile tile) {
        Point upperLeft = MercatorProjection.getPixelRelativeToTile(new LatLong(this.maxLatitude, minLongitude), tile);
        Point lowerRight = MercatorProjection.getPixelRelativeToTile(new LatLong(this.minLatitude, maxLongitude), tile);
        return new Rectangle(upperLeft.x, upperLeft.y, lowerRight.x, lowerRight.y);
    }
154003
function positionToMercator(position) {
    var lng = position[0];
    var lat = Math.max(Math.min(position[1], 89.99999), -89.99999);
    return [degToRad(lng) * EarthRadius, EarthRadius/2.0 * Math.log( (1.0 + Math.sin(degToRad(lat))) / (1.0 - Math.sin(degToRad(lat))) )];
  }
910940
function getAdjustedTileIndex({x, y, z}, adjustedZ) {
  const m = Math.pow(2, z - adjustedZ);
  return {
    x: Math.floor(x / m),
    y: Math.floor(y / m),
    z: adjustedZ
  };
}