move down y_dist, set x=0
193071
def generate_optimized_y_move_down_x_SOL(y_dist):
    

    # Optimization to move N lines and go to SOL in one command. Note that some terminals 
    # may not support this so we might have to remove this optimization or make it optional 
    # if that winds up mattering for terminals we care about. If we had to remove we'd
    # want to rework things such that we used "\x1b[{0}B" but also we would want to change
    # our interface to this function so we didn't guarantee x=0 since caller might ultimate 
    # want it in a different place and we don't want to output two x moves. Could pass in 
    # desired x, or return current x from here. 
          
    string = "\x1b[{0}E".format(y_dist)  # ANSI code to move down N lines and move x to SOL

    # Would a sequence of 1 or more \n chars be cheaper? If so we'll output that instead
    if y_dist < len(string):
        string = '\n' * y_dist
        
    return string
136579
function (line, dist) {
        var sum = 0;

        if (dist <= 0) return line[0];

        for (var i = 0; i < line.length - 1; i++) {
            var p0 = line[i];
            var p1 = line[i + 1];
            var d = this.distance(p0, p1);
            sum += d;
            if (sum > dist) return interpolate(p0, p1, (dist - (sum - d)) / d);
        }

        return line[line.length - 1];
    }
354123
def set_range_y(self,val):
        
        d = self.declaration
        if d.auto_range[1]:
            return
        self.widget.setYRange(*val,padding=0)
344156
def move(self, place, distance = 1):
        """"""
        x, y = self._get_position()
        if place == 'up':
            y -= distance
        elif place == 'down':
            for i in range(distance): print
            nx, ny = self._get_position()
            y = ny
            self.move('beginning of line')
        elif place == 'left':
            x -= distance
        elif place == 'right':
            x += distance
        elif place == 'beginning of line':
            x = 0
        elif place == 'beginning of screen':
            x = 0
            y = self._get_console_info()['window']['top']
        else:
            raise ValueError("invalid place to move")
        self._set_position((x, y))
640885
def set_position(x, y, stream=STD_OUTPUT_HANDLE):
    '''  '''
    stream = kernel32.GetStdHandle(stream)
    value = x + (y << 16)
    kernel32.SetConsoleCursorPosition(stream, c_long(value))
1098136
function moveTopDown(node, dx, dy) {
        var nodes = node.union(node.descendants());

        nodes.filter(":childless").positions(function (node, i) {
            if(typeof node === "number") {
              node = i;
            }
            var pos = node.position();
            return {
                x: pos.x + dx,
                y: pos.y + dy
            };
        });
    }
440445
def setCoords(self, x1, y1, x2, y2):
        """"""
        self.trans = Transform(self.size[0], self.size[1], x1, y1, x2, y2)
943086
function arrayMove(x, from, to) {
  const y = x.slice();
  y.splice((to < 0 ? y.length + to : to), 0, y.splice(from, 1)[0]);
  return y;
}
1134782
def _sbd(x, y):
    
    ncc = _ncc_c(x, y)
    idx = ncc.argmax()
    dist = 1 - ncc[idx]
    yshift = roll_zeropad(y, (idx + 1) - max(len(x), len(y)))

    return dist, yshift
320618
def _set_position(self, value):
        
        pX, pY = self.position
        x, y = value
        dX = x - pX
        dY = y - pY
        self.moveBy((dX, dY))
1260872
def set_goal(self, x: int, y: int) -> None:
        
        lib.TCOD_dijkstra_compute(self._path_c, x, y)
980718
public void setShift(double x, double y) {
		xx = 1;
		xy = 0;
		xd = x;
		yx = 0;
		yy = 1;
		yd = y;
	}
1231100
def dist_to(self, p2):
        """"""
        return math.hypot(self.x - p2.x, self.y - p2.y)
915384
function(dist) {
    var dx = Math.cos(this.dir) * dist;
    var dy = Math.sin(this.dir) * dist;

    // Move the player if they can walk here.
    this.x += (game.map.check(this.x + dx, this.y) <= 0) ? dx : 0;
    this.y += (game.map.check(this.x, this.y + dy) <= 0) ? dy : 0;

    this.steps += dist;

    // Update the position of the audio listener.
    Howler.pos(this.x, this.y, -0.5);
  }
984405
public void setPosition(int x,int y) {
		int cx = (xoffset.getMin() + xoffset.getMax()) / 2;
		int cy = (yoffset.getMin() + yoffset.getMax()) / 2;
		
		int dx = x - cx;
		int dy = y - cy;
		
		xoffset.setMin(xoffset.getMin() + dx);
		xoffset.setMax(xoffset.getMax() + dx);
		yoffset.setMin(yoffset.getMin() + dy);
		yoffset.setMax(yoffset.getMax() + dy);
		
		xoffset.fireUpdated(null);
		yoffset.fireUpdated(null);
	}
545540
private void sety2(double[] x, double[] y) {
        double p, qn, sig, un;
        double[] u = new double[n - 1];

        y2[0] = u[0] = 0.0;

        for (int i = 1; i < n - 1; i++) {
            sig = (x[i] - x[i - 1]) / (x[i + 1] - x[i - 1]);
            p = sig * y2[i - 1] + 2.0;
            y2[i] = (sig - 1.0) / p;
            u[i] = (y[i + 1] - y[i]) / (x[i + 1] - x[i]) - (y[i] - y[i - 1]) / (x[i] - x[i - 1]);
            u[i] = (6.0 * u[i] / (x[i + 1] - x[i - 1]) - sig * u[i - 1]) / p;
        }

        qn = un = 0.0;
        y2[n - 1] = (un - qn * u[n - 2]) / (qn * y2[n - 2] + 1.0);
        for (int k = n - 2; k >= 0; k--) {
            y2[k] = y2[k] * y2[k + 1] + u[k];
        }
    }
293811
def move_window(self, window, x, y):
        
        _libxdo.xdo_move_window(self._xdo, window, x, y)