Checks whether the scl string is the crosses relation.
553533
private static boolean crosses_(String scl, int dim_a, int dim_b) {
		if (dim_a > dim_b) {
			// Valid for area-Line, area-Point, Line-Point
			if (scl.charAt(0) == 'T' && scl.charAt(1) == '*'
					&& scl.charAt(2) == '*' && scl.charAt(3) == '*'
					&& scl.charAt(4) == '*' && scl.charAt(5) == '*'
					&& scl.charAt(6) == 'T' && scl.charAt(7) == '*'
					&& scl.charAt(8) == '*')
				return true;

			return false;
		}

		if (dim_a == 1 && dim_b == 1) {
			// Valid for Line-Line
			if (scl.charAt(0) == '0' && scl.charAt(1) == '*'
					&& scl.charAt(2) == '*' && scl.charAt(3) == '*'
					&& scl.charAt(4) == '*' && scl.charAt(5) == '*'
					&& scl.charAt(6) == '*' && scl.charAt(7) == '*'
					&& scl.charAt(8) == '*')
				return true;
		}

		return false;
	}
394962
def has_pathology_causal(graph: BELGraph, u: BaseEntity, v: BaseEntity, k: str) -> bool:
    
    return (
        isinstance(u, Pathology) and
        is_causal_relation(graph, u, v, k) and
        not isinstance(v, (Pathology, BiologicalProcess))
    )
1030198
protected function checkRelationName($sRelationName) : bool
    {
        $sCheckedRelationName = $this->getRelationName();
        if (empty($sCheckedRelationName)) {
            return true;
        }

        if (is_array($sCheckedRelationName) && in_array($sRelationName, $sCheckedRelationName)) {
            return true;
        }

        $bResult = $sRelationName == $sCheckedRelationName;

        return $bResult;
    }
1077230
public boolean hasRel(String rel) {

		Assert.hasText(rel, "Link relation must not be null or empty!");

		return hasRel(LinkRelation.of(rel));
	}
516318
function checkForStringConcat(node) {
            if (!astUtils.isStringLiteral(node) || !isConcatenation(node.parent)) {
                return;
            }

            const topBinaryExpr = getTopConcatBinaryExpression(node.parent);

            // Checks whether or not this node had been checked already.
            if (done[topBinaryExpr.range[0]]) {
                return;
            }
            done[topBinaryExpr.range[0]] = true;

            if (hasNonStringLiteral(topBinaryExpr)) {
                context.report({
                    node: topBinaryExpr,
                    message: "Unexpected string concatenation.",
                    fix: fixer => fixNonStringBinaryExpression(fixer, node)
                });
            }
        }
243145
private static boolean polygonCrossesPolyline_(Polygon polygon_a,
			Polyline polyline_b, double tolerance,
			ProgressTracker progress_tracker) {
		// Quick rasterize test to see whether the the geometries are disjoint,
		// or if one is contained in the other.
		int relation = tryRasterizedContainsOrDisjoint_(polygon_a, polyline_b,
				tolerance, false);

		if (relation == Relation.disjoint || relation == Relation.contains)
			return false;

		return polygonCrossesPolylineImpl_(polygon_a, polyline_b, tolerance,
				null);
	}
781321
static boolean isRelationalOperation(Node n) {
    switch (n.getToken()) {
      case GT: // equal
      case GE: // not equal
      case LT: // exactly equal
      case LE: // exactly not equal
        return true;
      default:
        break;
    }
    return false;
  }
1294155
public static boolean cs_lsolve(Scs L, float[] x) {
        int p, j, n, Lp[], Li[];
        float Lx[];
        if (!Scs_util.CS_CSC(L) || x == null)
            return (false); /* check inputs */
        n = L.n;
        Lp = L.p;
        Li = L.i;
        Lx = L.x;
        for (j = 0; j < n; j++) {
            x[j] /= Lx[Lp[j]];
            for (p = Lp[j] + 1; p < Lp[j + 1]; p++) {
                x[Li[p]] -= Lx[p] * x[j];
            }
        }
        return true;
    }
124490
public boolean crosses(Constituent c) {
    return (start() < c.start() && c.start() < end() && end() < c.end()) || (c.start() < start() && start() < c.end() && c.end() < end());
  }
1071897
private static boolean polylineDisjointPolyline_(Polyline polyline_a,
			Polyline polyline_b, double tolerance,
			ProgressTracker progress_tracker) {
		// Quick rasterize test to see whether the the geometries are disjoint.
		if (tryRasterizedContainsOrDisjoint_(polyline_a, polyline_b, tolerance,
				false) == Relation.disjoint)
			return true;

        MultiPathImpl multi_path_impl_a = (MultiPathImpl)polyline_a._getImpl();
        MultiPathImpl multi_path_impl_b = (MultiPathImpl)polyline_b._getImpl();

        PairwiseIntersectorImpl intersector_paths = new PairwiseIntersectorImpl(multi_path_impl_a, multi_path_impl_b, tolerance, true);

        if (!intersector_paths.next())
            return false;

		return !linearPathIntersectsLinearPath_(polyline_a, polyline_b,
				tolerance);
	}
236960
static boolean polylineRelatePolyline_(Polyline polyline_a,
			Polyline polyline_b, double tolerance, String scl,
			ProgressTracker progress_tracker) {
		RelationalOperationsMatrix relOps = new RelationalOperationsMatrix();
		relOps.resetMatrix_();
		relOps.setPredicates_(scl);
		relOps.setLineLinePredicates_();

		Envelope2D env_a = new Envelope2D(), env_b = new Envelope2D();
		polyline_a.queryEnvelope2D(env_a);
		polyline_b.queryEnvelope2D(env_b);

		boolean bRelationKnown = false;
		boolean b_disjoint = RelationalOperations.envelopeDisjointEnvelope_(
				env_a, env_b, tolerance, progress_tracker);

		if (b_disjoint) {
			relOps.lineLineDisjointPredicates_(polyline_a, polyline_b);
			bRelationKnown = true;
		}

		if (!bRelationKnown) {
			// Quick rasterize test to see whether the the geometries are
			// disjoint, or if one is contained in the other.
			int relation = RelationalOperations
					.tryRasterizedContainsOrDisjoint_(polyline_a, polyline_b,
							tolerance, false);

			if (relation == RelationalOperations.Relation.disjoint) {
				relOps.lineLineDisjointPredicates_(polyline_a, polyline_b);
				bRelationKnown = true;
			}
		}

		if (!bRelationKnown) {
			EditShape edit_shape = new EditShape();
			int geom_a = edit_shape.addGeometry(polyline_a);
			int geom_b = edit_shape.addGeometry(polyline_b);
			relOps.setEditShapeCrackAndCluster_(edit_shape, tolerance,
					progress_tracker);
			relOps.m_cluster_index_a = relOps.m_topo_graph
					.createUserIndexForClusters();
			relOps.m_cluster_index_b = relOps.m_topo_graph
					.createUserIndexForClusters();
			markClusterEndPoints_(geom_a, relOps.m_topo_graph,
					relOps.m_cluster_index_a);
			markClusterEndPoints_(geom_b, relOps.m_topo_graph,
					relOps.m_cluster_index_b);
			relOps.computeMatrixTopoGraphHalfEdges_(geom_a, geom_b);
			relOps.m_topo_graph
					.deleteUserIndexForClusters(relOps.m_cluster_index_a);
			relOps.m_topo_graph
					.deleteUserIndexForClusters(relOps.m_cluster_index_b);
			relOps.m_topo_graph.removeShape();
		}

		boolean bRelation = relationCompare_(relOps.m_matrix, relOps.m_scl);
		return bRelation;
	}
376288
def criss_cross?(other)
      # case 1: this one is horizontal:
      # overlaps other by x, to right and left, and goes inside it by y
      @x0 < other.x0 && @x1 > other.x1 &&
        @y0 > other.y0 && @y1 < other.y1 ||
        # case 2: this one is vertical:
        # overlaps other by y, to top and bottom, and goes inside it by x
        @y0 < other.y0 && @y1 > other.y1 &&
          @x0 > other.x0 && @x1 < other.x1
    end
392585
static boolean pointRelatePoint_(Point point_a, Point point_b,
			double tolerance, String scl, ProgressTracker progress_tracker) {
		Point2D pt_a = point_a.getXY();
		Point2D pt_b = point_b.getXY();
		int[] matrix = new int[9];

		for (int i = 0; i < 9; i++)
			matrix[i] = -1;

		if (Point2D.sqrDistance(pt_a, pt_b) <= tolerance * tolerance) {
			matrix[MatrixPredicate.InteriorInterior] = 0;
		} else {
			matrix[MatrixPredicate.InteriorExterior] = 0;
			matrix[MatrixPredicate.ExteriorInterior] = 0;
		}

		matrix[MatrixPredicate.ExteriorExterior] = 2;

		boolean bRelation = relationCompare_(matrix, scl);
		return bRelation;
	}
836483
def check_next_match(self, match, new_relations, subject_graph, one_match):
        """"""
        # only returns true for ecaxtly one set of new_relations from all the
        # ones that are symmetrically equivalent
        if not (self.criteria_sets is None or one_match):
            for check in self.duplicate_checks:
                vertex_a = new_relations.get(check[0])
                vertex_b = new_relations.get(check[1])
                if vertex_a is None and vertex_b is None:
                    continue # if this pair is completely absent in the new
                    # relations, it is either completely in the match or it
                    # is to be matched. So it is either already checked for
                    # symmetry duplicates, or it will be check in future.
                if vertex_a is None:
                    # maybe vertex_a is in the match and vertex_b is the only
                    # one in the new relations. try to get vertex_a from the
                    # match.
                    vertex_a = match.forward.get(check[0])
                    if vertex_a is None:
                        # ok, vertex_a is to be found, don't care about it right
                        # now. it will be checked in future calls.
                        continue
                elif vertex_b is None:
                    # maybe vertex_b is in the match and vertex_a is the only
                    # one in the new relations. try to get vertex_b from the
                    # match.
                    vertex_b = match.forward.get(check[1])
                    if vertex_b is None:
                        # ok, vertex_b is to be found, don't care about it right
                        # now. it will be checked in future calls.
                        continue
                if vertex_a > vertex_b:
                    # Why does this work? The answer is not so easy to explain,
                    # and certainly not easy to find. if vertex_a > vertex_b, it
                    # means that there is a symmetry operation that leads to
                    # an equivalent match where vertex_b < vertex_a. The latter
                    # match is preferred for as much pairs (vertex_a, vertex_b)
                    # as possible without rejecting all possible matches. The
                    # real difficulty is to construct a proper list of
                    # (vertex_a, vertex_b) pairs that will reject all but one
                    # matches. I conjecture that this list contains all the
                    # first two vertices from each normalized symmetry cycle of
                    # the pattern graph. We need a math guy to do the proof. -- Toon
                    return False
            return True
        return True
85607
@SuppressWarnings("unchecked")
   public static boolean typesMatch(Class<?>[] c1, Class[] c2) {
      if (c1.length != c2.length) {
         return false;
      }
      for (int i = 0; i < c1.length; i++) {
         if (!inSameHierarchy(c1[i], c2[i]) && !isConvertible(c1[i], c2[i])) {
            return false;
         }
      }
      return true;
   }
1140677
protected boolean isInside (int cross) {
        return (rule == WIND_NON_ZERO) ? Crossing.isInsideNonZero(cross) :
            Crossing.isInsideEvenOdd(cross);
    }
320433
private boolean isInMultipleLvalueDecl(Var v) {
    Token declarationType = v.declarationType();
    switch (declarationType) {
      case LET:
      case CONST:
      case VAR:
        Node nameDecl = NodeUtil.getEnclosingNode(v.getNode(), NodeUtil::isNameDeclaration);
        return NodeUtil.findLhsNodesInNode(nameDecl).size() > 1;
      default:
        return false;
    }
  }