:param: other - Line subclass
        :return: boolean

        Returns True iff:
           ccw(self.A,self.B,other.A) * ccw(self.A,self.B,other.B) <= 0
           and
           ccw(other.A,other.B,self.A) * ccw(other.A,other.B,self.B) <= 0
540612
def doesIntersect(self, other):
        '''
        

        '''
        if self.A.ccw(self.B, other.A) * self.A.ccw(self.B, other.B) > 0:
            return False

        if other.A.ccw(other.B, self.A) * other.A.ccw(other.B, self.B) > 0:
            return False

        return True
818419
def matched(self, other):
        
        mods = ["allocatable", "pointer"]
        return (self.kind.lower() == other.kind.lower() and
                self.dtype.lower() == other.dtype.lower() and
                self.D == other.D and
                all([m in other.modifiers for m in self.modifiers if m in mods]))
1249863
def equal(self, other, delta=0.0):
        
        if (other is None):
            return False
        if (self.uri != other.uri):
            return(False)
        if (self.timestamp is not None or other.timestamp is not None):
            # not equal if only one timestamp specified
            if (self.timestamp is None or
                    other.timestamp is None or
                    abs(self.timestamp - other.timestamp) >= delta):
                return(False)
        if ((self.md5 is not None and other.md5 is not None) and
                self.md5 != other.md5):
            return(False)
        if ((self.length is not None and other.length is not None) and
                self.length != other.length):
            return(False)
        return(True)
719735
def isCollinear(self, b, c):
        '''
        
        '''

        return all(self.ccw(b, c, axis) == 0 for axis in self._keys)
980173
private boolean isWrapper( Class<?> cls ) {
        if ( null == cls )
            return false;
        if ( Boolean.class.isAssignableFrom(cls) ) switch ( kind ) {
            case EQ: case NE: case BOOL_OR: case BOOL_ORX: case BOOL_AND:
            case BOOL_ANDX: case BIT_AND: case BIT_ANDX: case BIT_OR:
            case BIT_ORX: case XOR: case XORX:
                return true;
            default:
                return false;
        }
        if (Character.class.isAssignableFrom(cls)
            || Number.class.isAssignableFrom(cls)) switch ( kind ) {
            case BOOL_AND: case BOOL_ANDX: case BOOL_OR: case BOOL_ORX:
                return false;
            default:
                return true;
        }
        return false;
    }
286015
public static boolean isSubclass(Class a, Class b) {
		if (a == b)
			return false;
		if (!(b.isAssignableFrom(a)))
			return false;
		return true;
	}
12972
def perp_product(self, other):
        

        return self.x * other.y - self.y * other.x
517805
def canunion(self, other):
		''''''
		return not (self.max + bound(1) < other.min or other.max + bound(1) < self.min)
826096
def _isCompatible(self, other, reporter):
        
        glyph1 = self
        glyph2 = other
        # contour count
        if len(self.contours) != len(glyph2.contours):
            reporter.fatal = True
            reporter.contourCountDifference = True
        # contour pairs
        for i in range(min(len(glyph1), len(glyph2))):
            contour1 = glyph1[i]
            contour2 = glyph2[i]
            self._checkPairs(contour1, contour2, reporter, reporter.contours)
        # component count
        if len(glyph1.components) != len(glyph2.components):
            reporter.fatal = True
            reporter.componentCountDifference = True
        # component check
        component_diff = []
        selfComponents = [component.baseGlyph for component in glyph1.components]
        otherComponents = [component.baseGlyph for component in glyph2.components]
        for index, (left, right) in enumerate(
            zip_longest(selfComponents, otherComponents)
        ):
            if left != right:
                component_diff.append((index, left, right))

        if component_diff:
            reporter.warning = True
            reporter.componentDifferences = component_diff
            if not reporter.componentCountDifference and set(selfComponents) == set(
                otherComponents
            ):
                reporter.componentOrderDifference = True

            selfComponents_counted_set = collections.Counter(selfComponents)
            otherComponents_counted_set = collections.Counter(otherComponents)
            missing_from_glyph1 = (
                otherComponents_counted_set - selfComponents_counted_set
            )
            if missing_from_glyph1:
                reporter.fatal = True
                reporter.componentsMissingFromGlyph1 = sorted(
                    missing_from_glyph1.elements()
                )
            missing_from_glyph2 = (
                selfComponents_counted_set - otherComponents_counted_set
            )
            if missing_from_glyph2:
                reporter.fatal = True
                reporter.componentsMissingFromGlyph2 = sorted(
                    missing_from_glyph2.elements()
                )
        # guideline count
        if len(self.guidelines) != len(glyph2.guidelines):
            reporter.warning = True
            reporter.guidelineCountDifference = True
        # guideline check
        selfGuidelines = []
        otherGuidelines = []
        for source, names in ((self, selfGuidelines),
                              (other, otherGuidelines)):
            for i, guideline in enumerate(source.guidelines):
                names.append((guideline.name, i))
        guidelines1 = set(selfGuidelines)
        guidelines2 = set(otherGuidelines)
        if len(guidelines1.difference(guidelines2)) != 0:
            reporter.warning = True
            reporter.guidelinesMissingFromGlyph2 = list(
                guidelines1.difference(guidelines2))
        if len(guidelines2.difference(guidelines1)) != 0:
            reporter.warning = True
            reporter.guidelinesMissingFromGlyph1 = list(
                guidelines2.difference(guidelines1))
        # anchor count
        if len(self.anchors) != len(glyph2.anchors):
            reporter.warning = True
            reporter.anchorCountDifference = True
        # anchor check
        anchor_diff = []
        selfAnchors = [anchor.name for anchor in glyph1.anchors]
        otherAnchors = [anchor.name for anchor in glyph2.anchors]
        for index, (left, right) in enumerate(zip_longest(selfAnchors, otherAnchors)):
            if left != right:
                anchor_diff.append((index, left, right))

        if anchor_diff:
            reporter.warning = True
            reporter.anchorDifferences = anchor_diff
            if not reporter.anchorCountDifference and set(selfAnchors) == set(
                otherAnchors
            ):
                reporter.anchorOrderDifference = True

            selfAnchors_counted_set = collections.Counter(selfAnchors)
            otherAnchors_counted_set = collections.Counter(otherAnchors)
            missing_from_glyph1 = otherAnchors_counted_set - selfAnchors_counted_set
            if missing_from_glyph1:
                reporter.anchorsMissingFromGlyph1 = sorted(
                    missing_from_glyph1.elements()
                )
            missing_from_glyph2 = selfAnchors_counted_set - otherAnchors_counted_set
            if missing_from_glyph2:
                reporter.anchorsMissingFromGlyph2 = sorted(
                    missing_from_glyph2.elements()
                )
27329
def overlaps(self, other):
        
        if self.chrom != other.chrom: return False
        if self.start >= other.end: return False
        if other.start >= self.end: return False
        return True
1202771
def lub(self, other):
        
        return self.__class__(
            [
                max(self.lower, other.lower),
                max(self.upper, other.upper),
            ],
            lower_inc=self.lower_inc if self < other else other.lower_inc,
            upper_inc=self.upper_inc if self > other else other.upper_inc,
        )
33784
def dock(self, other):
		'''
			
		'''

		# e.g. self has mults at indices [0, 1, 2, 3, 4, 5, 6] len=7
		# e.g. other has mults at indices [0, 1, 2] len=3
		new = list(self.mults)
		for i in reversed(range(len(other.mults))): # [2, 1, 0]
			# e.g. i = 1, j = 7 - 3 + 1 = 5
			j = len(self.mults) - len(other.mults) + i
			new[j] = new[j].dock(other.mults[i])

			if new[j].multiplier == zero:
				# omit that mult entirely since it has been factored out
				del new[j]

			# If the subtraction is incomplete but there is more to
			# other.mults, then we have a problem. For example, "ABC{2} - BC"
			# subtracts the C successfully but leaves something behind,
			# then tries to subtract the B too, which isn't possible
			else:
				if i != 0:
					raise Exception("Can't subtract " + repr(other) + " from " + repr(self))

		return conc(*new)
733724
def +(other)
      case other
      when LinExpr
        # Add the terms of two expressions
        # For now, this assumes variables are not duplicated
        LinExpr.new(@terms.merge(other.terms) { |_, c1, c2| c1 + c2 })
      when Variable
        # Add the variable to the expression
        self + other * 1.0
      else
        fail TypeError
      end
    end
912213
def does_match_definition(given, main, secondary):
    """"""
    assert isinstance(secondary, tuple)
    assert len(secondary) == 2  # general solution could be provided
    types = decompose_type(given)

    if isinstance(types[0], main):
        return True

    if len(types) >= 2:
        cond1 = isinstance(types[0], main)
        cond2 = isinstance(types[1], secondary)
        cond3 = isinstance(types[1], main)
        cond4 = isinstance(types[0], secondary)
        if (cond1 and cond2) or (cond3 and cond4):
            return True

        if len(types) >= 3:
            classes = set([tp.__class__ for tp in types[:3]])
            desired = set([main] + list(secondary))
            diff = classes.symmetric_difference(desired)
            if not diff:
                return True
            if len(diff) == 2:
                items = list(diff)
                return (
                    issubclass(
                        items[0], items[1]) or issubclass(items[1], items[0]))
            return False
    else:
        return False
1374512
def Equals(self, other):
    
    return (self._approxEq(self.x, other.x)
            and self._approxEq(self.y, other.y)
            and self._approxEq(self.z, other.z))
175092
def is_disjoint(self,other):
        
        if self.is_empty() or other.is_empty():
            return True

        if self.bounds[0] < other.bounds[0]:
            i1,i2 = self,other
        elif self.bounds[0] > other.bounds[0]:
            i2,i1 = self,other
        else:
            #coincident lower bounds
            if self.is_discrete() and not other.included[0]:
                return True
            elif other.is_discrete() and not self.included[0]:
                return True
            else:
                return False

        return not i2.bounds[0] in i1
1227082
function ccw (ax, ay, bx, by, cx, cy) {
  var raw = ccwRaw(ax, ay, bx, by, cx, cy)
  return (raw === 0) ? 0 : raw / Math.abs(raw)
}