Calculate destination from locations.
510484
def destination(globs, locator, distance, bearing):
    """"""
    globs.locations.destination(distance, bearing, locator)
197630
function processDestination(destination) {
    var destinations = [];

    if (_.isArray(destination)) {
      destinations = destination;
    }
    if (_.isString(destination)) {
      destinations.push(destination);
    }
    if (!destinations.length) {
      throw new Error('Destination file not defined.');
    }
    return destinations.map(util.resolveEnsureFile);
  }
800188
def bpoints(self):
        """"""
        return self.start, self.control1, self.control2, self.end
463051
private void computeBitLocations() {
		int N = numRows;
		int row = N-1;
		int col = N-1;
		int direction = -1;

		while (col > 0) {
			if (col == 6)
				col -= 1;

			if (!get(row,col)) {
				bits.add( new Point2D_I32(col,row));
			}
			if (!get(row,col-1)) {
				bits.add( new Point2D_I32(col-1,row));
			}

			row += direction;

			if (row < 0 || row >= N) {
				direction = -direction;
				col -= 2;
				row += direction;
			}
		}
	}
719940
def path_get_destination(p: tcod.path.AStar) -> Tuple[int, int]:
    
    x = ffi.new("int *")
    y = ffi.new("int *")
    lib.TCOD_path_get_destination(p._path_c, x, y)
    return x[0], y[0]
239220
def handle_json_GET_neareststops(self, params):
    """'"""
    schedule = self.server.schedule
    lat = float(params.get('lat'))
    lon = float(params.get('lon'))
    limit = int(params.get('limit'))
    stops = schedule.GetNearestStops(lat=lat, lon=lon, n=limit)
    return [StopToTuple(s) for s in stops]
1087421
def destinations(self):
        
        session = meta.Session()
        sel = select([distinct(model.frames_table.c.destination)])
        result = session.execute(sel)
        return set([r[0] for r in result.fetchall()])
530933
function calculateStopPositions(stop1, stop2, count) {
    var good = function (values, unit) {
        return { values: values, unit: unit };
    };
    var bad = function (warning) {
        return { values: false, unit: '', warning: warning };
    };

    // Exit early if either value is calc()
    if (stop1 && isCalc(stop1.positionNode) || stop2 && isCalc(stop2.positionNode)) {
        return bad(errorStopPosition);
    }

    var startPos, endPos, baseUnit;
    var hasStartPos = true;
    var hasEndPos = true;

    var pos1 = stop1 && unitValue(stop1.positionNode);
    var pos2 = stop2 && unitValue(stop2.positionNode);
    if (!pos1) {
        hasStartPos = false;
        pos1 = { number: '0', unit: '%' };
    } else {
        count++;
    }
    if (!pos2) {
        hasEndPos = false;
        pos2 = { number: '100', unit: '%' };
    } else {
        count++;
    }

    // Check if missing stops can be calculated
    if (pos1.unit !== pos2.unit) {
        return bad(errorStopPosition);
    }
    startPos = +pos1.number || 0;
    endPos = +pos2.number || 0;
    baseUnit = pos1.unit;

    // Generate as many missing positions as required
    var positions = midRange(startPos, endPos, count);
    // Take off any known positions
    if (hasStartPos) {
        positions.shift();
    }
    if (hasEndPos) {
        positions.pop();
    }

    return good(positions, baseUnit);
}
116423
def move_to(self, destination):
        
        target = self.__get_destination__(destination)
        logger.info("Move %s to %s" % (self, target))
        shutil.move(self.path, unicode(target))
        return target
83906
def get(self, pos):
        """"""
        latitude = int(round(pos['latitude']))
        search_set = self.bins[latitude]
        i = 1
        if latitude - i >= -90:
            search_set += self.bins[latitude-i]
        if latitude + i <= 90:
            search_set += self.bins[latitude+i]
        while len(search_set) == 0 and i <= 200:
            if latitude - i >= -90:
                search_set += self.bins[latitude-i]
            if latitude + i <= 90:
                search_set += self.bins[latitude+i]
            i += 1
        return find_closest(search_set, pos)
694
def map_position(pos):
    """"""

    posiction_dict = dict(zip(range(1, 17), [i for i in range(30, 62) if i % 2]))
    return posiction_dict[pos]
562051
def location(self):
        """"""
        location = self._device_json.get(CONST.LOCATION, {})

        return (location.get(CONST.LOCATION_LAT, 0),
                location.get(CONST.LOCATION_LNG, 0))
842895
function estimateCost(from, endPoints) {

        var min = Infinity;

        for (var i = 0, len = endPoints.length; i < len; i++) {
            var cost = from.manhattanDistance(endPoints[i]);
            if (cost < min) min = cost;
        }

        return min;
    }
348015
public static void computePosition (
        Point start, Point end, long elapsed, long duration, Point pos)
    {
        float pct = (float)elapsed / duration;
        int travx = (int)((end.x - start.x) * pct);
        int travy = (int)((end.y - start.y) * pct);
        pos.setLocation(start.x + travx, start.y + travy);
    }
80641
def location_check(lat, lon):
        """"""
        if not (isinstance(lat, number_types) and -90 <= lat <= 90):
            raise ValueError("Latitude: '{latitude}' invalid".format(latitude=lat))

        if not (isinstance(lon, number_types) and -180 <= lon <= 180):
            raise ValueError("Longitude: '{longitude}' invalid".format(longitude=lon))
670012
def trips(self):
    """"""
    trips = set()
    for route in self.routes():
      trips |= route.trips()
    return trips
139061
def calc_all_routes_info(self, npaths=3, real_time=True, stop_at_bounds=False, time_delta=0):
        """"""

        routes = self.get_route(npaths, time_delta)
        results = {route['routeName']: self._add_up_route(route['results'], real_time=real_time, stop_at_bounds=stop_at_bounds) for route in routes}
        route_time = [route[0] for route in results.values()]
        route_distance = [route[1] for route in results.values()]
        self.log.info('Time %.2f - %.2f minutes, distance %.2f - %.2f km.', min(route_time), max(route_time), min(route_distance), max(route_distance))
        return results