Finds a minimum cost path and adds it to the matching
334791
def _augment(self):
        
        #build a minimum cost tree
        _pred, _ready, istar, j, mu = self._build_tree()

        #update prices
        self._v[_ready] += self._d[_ready] - mu

        #augment the solution with the minimum cost path from the
        #tree. Follows an alternating path along matched, unmatched
        #edges from X to Y
        while True:
            i = _pred[j]
            self._y[j] = i
            k = j
            j = self._x[i]
            self._x[i] = k
            if i == istar:
                break
        self._update_cred()
541911
def find_path_join_using_plus(node):
    """"""
    return (
        isinstance(node, ast.BinOp)
        and isinstance(node.op, ast.Add)
        and isinstance(node.left, ast.BinOp)
        and isinstance(node.left.op, ast.Add)
        and isinstance(node.left.right, ast.Str)
        and node.left.right.s in ['/', "\\"]
    )
847419
public static double approxSumPaths(WeightedIntDiGraph g, RealVector startWeights, RealVector endWeights,
            Iterator<DiEdge> seq, DoubleConsumer c) {
        // we keep track of the total weight of discovered paths ending along
        // each edge and the total weight
        // of all paths ending at each node (including the empty path); on each
        // time step, we
        // at each step, we pick an edge (s, t), update the sum at s, and extend
        // each of those (including
        // the empty path starting there) with the edge (s, t)

        DefaultDict<DiEdge, Double> prefixWeightsEndingAt = new DefaultDict<DiEdge, Double>(Void -> 0.0);

        // we'll maintain node sums and overall sum with subtraction rather than
        // re-adding (it's an approximation anyway!)
        RealVector currentSums = startWeights.copy();
        double currentTotal = currentSums.dotProduct(endWeights);
        if (c != null) {
            c.accept(currentTotal);
        }
        for (DiEdge e : ScheduleUtils.iterable(seq)) {
            int s = e.get1();
            int t = e.get2();
            // compute the new sums
            double oldTargetSum = currentSums.getEntry(t);
            double oldEdgeSum = prefixWeightsEndingAt.get(e);
            // new edge sum is the source sum times the edge weight
            double newEdgeSum = currentSums.getEntry(s) * g.getWeight(e);
            // new target sum is the old target sum plus the difference between
            // the new and old edge sums
            double newTargetSum = oldTargetSum + (newEdgeSum - oldEdgeSum);
            // the new total is the old total plus the difference in new and
            // target
            double newTotal = currentTotal + (newTargetSum - oldTargetSum) * endWeights.getEntry(t);
            // store the new sums
            prefixWeightsEndingAt.put(e, newEdgeSum);
            currentSums.setEntry(t, newTargetSum);
            currentTotal = newTotal;
            // and report the new total to the consumer
            if (c != null) {
                c.accept(currentTotal);
            }
        }
        return currentTotal;
    }
404347
def setpathcost(self, port, cost):
        
        _runshell([brctlexe, 'setpathcost', self.name, port, str(cost)],
            "Could not set path cost in port %s in %s." % (port, self.name))
738774
private void optimize(NavPath path) {
		int pt = 0;
		
		while (pt < path.length()-2) {
			float sx = path.getX(pt);
			float sy = path.getY(pt);
			float nx = path.getX(pt+2);
			float ny = path.getY(pt+2);
			
			if (isClear(sx,sy,nx,ny,0.1f)) {
				path.remove(pt+1);
			} else {
				pt++;
			}
		}
	}
294281
def add_path(self, w, h):
        """"""
        path = self._add_path()
        path.w, path.h = w, h
        return path
419036
public void applyToPath(Matrix transform, Path path) {
        for (int i = 0, size = operations.size(); i < size; i++) {
            PathOperation operation = operations.get(i);
            operation.applyToPath(transform, path);
        }
    }
1198763
def min_cost(self):
        
        if self._min_cost:
            return self._min_cost
        self._min_cost = np.sum(self.c[np.arange(self.nx), self.solution])
        return self._min_cost
1337453
private Match matchImpl(List<Entry> desiredLocales, int threshold) {
    int bestDistance = MAX_DISTANCE;
    Entry bestMatch = null;
    for (Entry desired : desiredLocales) {
      List<String> exact = exactMatch.get(desired.locale);
      if (exact != null) {
        return new Match(exact.get(0), 0);
      }
      for (Entry supported : supportedLocales) {
        int distance = DISTANCE_TABLE.distance(desired.locale, supported.locale, threshold);
        if (distance < bestDistance) {
          bestDistance = distance;
          bestMatch = supported;
        }
      }
    }
    return bestMatch == null 
        ? new Match(firstEntry.bundleId, MAX_DISTANCE)
        : new Match(bestMatch.bundleId, bestDistance);
  }
277567
protected static float costReplace(char x, char y) {
		int cost = 1;
		for(char[] xy: repCostChars){
			if(xy[0]==x&&xy[1]==y){
				cost =2;
				break;
			}else if(xy[0]==y&&xy[1]==x){
				cost =2;
				break;
			}
		}
		return cost;//noCostChars.indexOf(c)!=-1?1:0;
	}
1113011
function findPath(path, directories) {
  var cwd = directories[0];

  if (!cwd) {
    return null;
  }

  return findup(path, {cwd: cwd}) || findPath(path, slice.call(directories, 1));
}
22572
def finding_path(cls, organization, source, finding):
        """"""
        return google.api_core.path_template.expand(
            "organizations/{organization}/sources/{source}/findings/{finding}",
            organization=organization,
            source=source,
            finding=finding,
        )
314488
function(req, res, router) {
    if (router.static) {
      findPath(req, res, router, function() {
        if (!routeFinder(router, req, res)) {
          routeNoFound(req, res);
        }
      });
    } else {
      if (!routeFinder(router, req, res)) {
        routeNoFound(req, res);
      }
    }
  }
1291822
function mirrorPaths(paths, xScale, yScale) {

            var bound = computeBoundingBox.computePath.apply(null, paths);
            var x = bound.x;
            var y = bound.y;
            var w = bound.width;
            var h = bound.height;

            if (xScale === -1) {
                paths.forEach(function (p) {
                    pathAdjust(p, -1, 1, -x, 0);
                    pathAdjust(p, 1, 1, x + w, 0);
                    p.reverse();
                });

            }

            if (yScale === -1) {
                paths.forEach(function (p) {
                    pathAdjust(p, 1, -1, 0, -y);
                    pathAdjust(p, 1, 1, 0, y + h);
                    p.reverse();
                });
            }

            return paths;
        }
718596
def path_ok(match_tuple: MatchTuple) -> bool:
    """"""
    relative_path = match_tuple.link.split("#")[0]
    full_path = os.path.join(os.path.dirname(str(match_tuple.source)), relative_path)
    return os.path.exists(full_path)
214502
def path_join(*args):
    """"""
    return SEP.join((x for x in args if x not in (None, ''))).strip(SEP)
236036
def match(self, path):
        
        """
        for spec in reversed(self.pathspecs):  # type: Pathspec
            if spec.pattern.match(path):
                return not spec.negated

        return False