adds a rectangular closed Path to the MultiPathImpl.

@param envSrc
is the source rectangle.
@param bReverse
Creates reversed path.
485388
public void addEnvelope(Envelope envSrc, boolean bReverse) {
		if (envSrc.isEmpty())
			return;

		boolean bWasEmpty = m_pointCount == 0;
		Point pt = new Point(m_description);// getDescription());
		for (int i = 0, n = 4; i < n; i++) {
			int j = bReverse ? n - i - 1 : i;

			envSrc.queryCornerByVal(j, pt);
			if (i == 0)
				startPath(pt);
			else
				lineTo(pt);
		}

		closePathWithLine();
		m_bPathStarted = false;

		if (bWasEmpty && !bReverse)
			_setDirtyFlag(DirtyFlags.DirtyIsEnvelope, false);// now we know the
																// polypath is
																// envelope
	}
1233737
function getPathToCircularRef(obj, cache, currentPath){
	var circPath = [];
	if(typeof obj != 'object')
		return circPath;

	if(!cache.objects){
		cache.objects = [];
		cache.paths = [];
	}
	var pos = cache.objects.indexOf(obj);
	if(pos >= 0)
		circPath = cache.paths[pos];

	cache.objects.push(obj);
	cache.paths.push(currentPath);

	return circPath;
}
1097211
private AtlasEdge createInverseReference(AtlasAttribute inverseAttribute, AtlasStructType inverseAttributeType,
                                             AtlasVertex inverseVertex, AtlasVertex vertex) throws AtlasBaseException {

        String propertyName     = AtlasGraphUtilsV1.getQualifiedAttributePropertyKey(inverseAttributeType, inverseAttribute.getName());
        String inverseEdgeLabel = AtlasGraphUtilsV1.getEdgeLabel(propertyName);
        AtlasEdge ret;

        try {
            ret = graphHelper.getOrCreateEdge(inverseVertex, vertex, inverseEdgeLabel);

        } catch (RepositoryException e) {
            throw new AtlasBaseException(AtlasErrorCode.INTERNAL_ERROR, e);
        }

        return ret;
    }
345465
function rebalanceAlongPath(node, path) {
		var newRoot = node, 
			rotated, i;
		if (!node.hasOwnProperty('key')) { delete node.height; return node; }   // Empty tree
		// Rebalance the tree and update all heights
		for (i = path.length - 1; i >= 0; i -= 1) {
			path[i].height = 1 + Math.max(path[i].left ? path[i].left.height : 0, path[i].right ? path[i].right.height : 0);
			if (balanceFactor(path[i]) > 1) {
				rotated = rightTooSmall(path[i]);
				if (i === 0) { newRoot = rotated; }
			}
			if (balanceFactor(path[i]) < -1) {
				rotated = leftTooSmall(path[i]);
				if (i === 0) { newRoot = rotated; }
			}
		}
		return newRoot;
	}
231700
public void add(MultiPath src, boolean bReversePaths) {
		m_impl.add((MultiPathImpl) src._getImpl(), bReversePaths);
	}
76435
public static Path buildRelativeDestinationPath(Path destinationDirPath,
			Path baseDirPath, Path sourcePath) {
		Path extractSubPath = extractSubPath(baseDirPath, sourcePath);
		return destinationDirPath.resolve(extractSubPath);
	}
1264983
private void addObjectReferenceEdges(Vertex vertex, ObjectReferenceDescriptor rds)
    {
        Object refObject = rds.getPersistentField().get(vertex.getEnvelope().getRealObject());
        Class refClass = rds.getItemClass();
        for (int i = 0; i < vertices.length; i++)
        {
            Edge edge = null;
            // ObjectEnvelope envelope = vertex.getEnvelope();
            Vertex refVertex = vertices[i];
            ObjectEnvelope refEnvelope = refVertex.getEnvelope();
            if (refObject == refEnvelope.getRealObject())
            {
                edge = buildConcrete11Edge(vertex, refVertex, rds.hasConstraint());
            }
            else if (refClass.isInstance(refVertex.getEnvelope().getRealObject()))
            {
                edge = buildPotential11Edge(vertex, refVertex, rds.hasConstraint());
            }
            if (edge != null)
            {
                if (!edgeList.contains(edge))
                {
                    edgeList.add(edge);
                }
                else
                {
                    edge.increaseWeightTo(edge.getWeight());
                }
            }
        }
    }
1352088
def set_env(envName, envValue):
    
    os.environ[envName] = os.environ[envName] + ':' + envValue
479842
private void buildReverse(List<List<Vertex>> adjacencyList,
                              LinkedList<X509Certificate> certPathList)
        throws GeneralSecurityException, IOException
    {
        if (debug != null) {
            debug.println("SunCertPathBuilder.buildReverse()...");
            debug.println("SunCertPathBuilder.buildReverse() InitialPolicies: "
                + buildParams.initialPolicies());
        }

        ReverseState currentState = new ReverseState();
        /* Initialize adjacency list */
        adjacencyList.clear();
        adjacencyList.add(new LinkedList<Vertex>());

        /*
         * Perform a search using each trust anchor, until a valid
         * path is found
         */
        Iterator<TrustAnchor> iter = buildParams.trustAnchors().iterator();
        while (iter.hasNext()) {
            TrustAnchor anchor = iter.next();

            /* check if anchor satisfies target constraints */
            if (anchorIsTarget(anchor, buildParams.targetCertConstraints())) {
                this.trustAnchor = anchor;
                this.pathCompleted = true;
                this.finalPublicKey = anchor.getTrustedCert().getPublicKey();
                break;
            }

            // skip anchor if it contains a DSA key with no DSA params
            X509Certificate trustedCert = anchor.getTrustedCert();
            PublicKey pubKey = trustedCert != null ? trustedCert.getPublicKey()
                                                   : anchor.getCAPublicKey();

            if (PKIX.isDSAPublicKeyWithoutParams(pubKey)) {
                continue;
            }

            /* Initialize current state */
            currentState.initState(buildParams);
            currentState.updateState(anchor, buildParams);

            currentState.algorithmChecker = new AlgorithmChecker(anchor);
            currentState.untrustedChecker = new UntrustedChecker();
            try {
                depthFirstSearchReverse(null, currentState,
                                        new ReverseBuilder(buildParams),
                                        adjacencyList, certPathList);
            } catch (GeneralSecurityException | IOException e) {
                // continue on error if more anchors to try
                if (iter.hasNext())
                    continue;
                else
                    throw e;
            }

            // break out of loop if search is successful
            if (pathCompleted) {
                break;
            }
        }

        if (debug != null) {
            debug.println("SunCertPathBuilder.buildReverse() returned from "
                + "depthFirstSearchReverse()");
            debug.println("SunCertPathBuilder.buildReverse() "
                + "certPathList.size: " + certPathList.size());
        }
    }
939669
public void addInInclusionChain(final URI path, final String pointer)
            throws XIncludeFatalException
    {
        final String xincludePath = path.toASCIIString() + ((null != pointer) ? ('#' + pointer) : "");
        if (this.xincludeDeque.contains(xincludePath))
        {
            throw new XIncludeFatalException("Inclusion Loop on path: " + xincludePath);
        }
        this.xincludeDeque.addLast(xincludePath);
    }
1206786
def _get_envs_from_ref_paths(self, refs):
        '''
        
        '''
        def _check_ref(env_set, rname):
            '''
            Add the appropriate saltenv(s) to the set
            '''
            if rname in self.saltenv_revmap:
                env_set.update(self.saltenv_revmap[rname])
            else:
                if rname == self.base:
                    env_set.add('base')
                elif not self.disable_saltenv_mapping:
                    env_set.add(rname)

        use_branches = 'branch' in self.ref_types
        use_tags = 'tag' in self.ref_types

        ret = set()
        if salt.utils.stringutils.is_hex(self.base):
            # gitfs_base or per-saltenv 'base' may point to a commit ID, which
            # would not show up in the refs. Make sure we include it.
            ret.add('base')
        for ref in salt.utils.data.decode(refs):
            if ref.startswith('refs/'):
                ref = ref[5:]
            rtype, rname = ref.split('/', 1)
            if rtype == 'remotes' and use_branches:
                parted = rname.partition('/')
                rname = parted[2] if parted[2] else parted[0]
                _check_ref(ret, rname)
            elif rtype == 'tags' and use_tags:
                _check_ref(ret, rname)

        return ret
1364681
private Path<?> buildPropertyPathForAnyType(Root<T> root, String stringPath) {
		
		// Si la racine est nulle
		if(root == null) return null;
		
		// Si la chaine est vide
		if(stringPath == null || stringPath.trim().length() == 0) return null;
		
		// Le Path à retournet
		Path<?> path = null;
		
		// On splitte sur le séparateur de champs
		String[] hierarchicalPaths = stringPath.trim().split("\\.");
		
		// Obtention du premier chemin
		path = root.get(hierarchicalPaths[0]);
		
		// Si la taille est > 1
		if(hierarchicalPaths.length > 1) {

			// Parcours
			for (int i = 1; i < hierarchicalPaths.length; i++) {
				
				// Le chemin
				String unitPath = hierarchicalPaths[i];
				
				// Si le path est vide ou est une suite d'espace
				if(unitPath == null || unitPath.trim().length() == 0) continue;
				
				// Acces à la ppt
				path = path.get(unitPath.trim());
			}
		}
		
		// On retourne le Path
		return path;
	}
1029170
private static boolean linearPathIntersectsEnvelope_(MultiPath multipath_a,
			Envelope2D env_b, double tolerance, ProgressTracker progress_tracker) {
		if (!multipath_a.hasNonLinearSegments()) {
			Envelope2D env_b_inflated = new Envelope2D();
			env_b_inflated.setCoords(env_b);
			env_b_inflated.inflate(tolerance, tolerance);
			MultiPathImpl mimpl_a = (MultiPathImpl) multipath_a._getImpl();
			AttributeStreamOfDbl xy = (AttributeStreamOfDbl) (mimpl_a
					.getAttributeStreamRef(VertexDescription.Semantics.POSITION));
			Point2D pt = new Point2D();
			Point2D pt_prev = new Point2D();
			Point2D pt_1 = new Point2D();
			Point2D pt_2 = new Point2D();
			for (int ipath = 0, npath = mimpl_a.getPathCount(); ipath < npath; ipath++) {
				boolean b_first = true;
				for (int i = mimpl_a.getPathStart(ipath), n = mimpl_a
						.getPathEnd(ipath); i < n; i++) {
					if (b_first) {
						xy.read(2 * i, pt_prev);
						b_first = false;
						continue;
					}

					xy.read(2 * i, pt);
					pt_1.setCoords(pt_prev);
					pt_2.setCoords(pt);
					if (env_b_inflated.clipLine(pt_1, pt_2) != 0)
						return true;

					pt_prev.setCoords(pt);
				}
			}
		} else {
			Line line_1 = new Line(env_b.xmin, env_b.ymin, env_b.xmin,
					env_b.ymax);
			Line line_2 = new Line(env_b.xmin, env_b.ymax, env_b.xmax,
					env_b.ymax);
			Line line3 = new Line(env_b.xmax, env_b.ymax, env_b.xmax,
					env_b.ymin);
			Line line4 = new Line(env_b.xmax, env_b.ymin, env_b.xmin,
					env_b.ymin);
			SegmentIterator iter = multipath_a.querySegmentIterator();
			while (iter.nextPath()) {
				while (iter.hasNextSegment()) {
					Segment polySeg = iter.nextSegment();
					if (polySeg.isIntersecting(line_1, tolerance))
						return true;

					if (polySeg.isIntersecting(line_2, tolerance))
						return true;

					if (polySeg.isIntersecting(line3, tolerance))
						return true;

					if (polySeg.isIntersecting(line4, tolerance))
						return true;
				}
			}
		}

		return false;
	}
899140
def create_path_env_var(new_entries, env=None, env_var='PATH', delimiter=':', prepend=False):
  """"""
  if env is None:
    env = {}

  prev_path = env.get(env_var, None)
  if prev_path is None:
    path_dirs = list()
  else:
    path_dirs = list(prev_path.split(delimiter))

  new_entries_list = list(new_entries)

  if prepend:
    path_dirs = new_entries_list + path_dirs
  else:
    path_dirs += new_entries_list

  return delimiter.join(path_dirs)
1096501
function AddrRange(begin, end) {
  begin = _toAddr(begin);
  end = _toAddr(end);

  if (begin.compare(end) > 0) {
    throw new Error('begin address must be <= end address');
  }

  this._begin = begin;
  this._end = end;
}
386179
def get_endpoint_and_path(environ):
    
    path = environ['PATH_INFO']
    components = path.split('/')

    if '..' in components:
        raise HttpError('400 Bad Request', 'Path cannot contain "..".')

    # Strip closing slash
    if components and components[-1] == '':
        components.pop()

    # If path contained '//', get the segment after the last occurence
    try:
        first = _rindex(components, '') + 1
    except ValueError:
        first = 0

    components = components[first:]

    if len(components) == 0:
        return '', ''
    else:
        return components[0], '/'.join(components[1:])
800177
public void setAuxClasspathRef(Reference r) {
        Path path = createAuxClasspath();
        path.setRefid(r);
        path.toString(); // Evaluated for its side-effects (throwing a
        // BuildException)
    }