Check whether two Intervals are disjoint.

        :param Interval other: The Interval to check disjointedness with.
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
1318727
def canintersect(self, other):
		'''
			
		'''
		return not (self.max < other.min or other.max < self.min)
79917
def is_contradictory(self, other):
        
        other = StringCell.coerce(other)

        if self.value is None or other.value is None:
            # None = empty, and won't contradict anything
            return False

        def sequence_in(s1, s2):
            """Does `s1` appear in sequence in `s2`?"""
            return bool(re.search(".*".join(s1), s2))

        return not sequence_in(self.value, other.value) and \
            not sequence_in(other.value, self.value)
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
990233
def is_adjacent(self, other: ops.Qid) -> bool:
        """"""
        return (isinstance(other, GridQubit) and
                abs(self.row - other.row) + abs(self.col - other.col) == 1)
47101
def IS(instance, other):  # noqa
    
    try:
        instance = instance._redpipe_future_result  # noqa
    except AttributeError:
        pass

    try:
        other = other._redpipe_future_result
    except AttributeError:
        pass

    return instance is other
56056
def _check_overlap(self, fragment):
        
        #
        # NOTE bisect does not work if there is a configuration like:
        #
        #      *********** <- existing interval
        #           ***    <- query interval
        #
        # TODO one should probably check this by doing bisect
        #      over the begin and end lists separately
        #
        for existing_fragment in self.fragments:
            if existing_fragment.interval.relative_position_of(fragment.interval) not in self.ALLOWED_POSITIONS:
                self.log_exc(u"interval overlaps another already present interval", None, True, ValueError)
1104336
def _parse_nested_interval(self, tokens):
        
        if tokens[0].isdigit():
            return self._parse_interval(tokens)
        elif tokens[0] in ['join', 'order']:
            return self._parse_join(tokens)
        elif tokens[0] == 'complement':
            return self._parse_complement(tokens)
        raise ValueError('interval {} does not fit pattern.'.format(tokens))
438457
def Contains(self, other):
        
        if other is None:
            raise ValueError("other is None.")

        if isinstance(other, Range):
            if other.low >= self.low and other.high <= self.high:
                return True
            return False
        else:
            return self.Contains(Range(other, other))
1341524
public Interval expand(Interval<E> other)
  {
    if (other == null) return this;
    E a = min(this.first, other.first);
    E b = max(this.second, other.second);
    return toInterval(a,b);
  }
1364257
def union(self,other):
        
        if self.everything:
            return self
        elif other.everything:
            return other
        else:
            return DiscreteSet(self.elements.union(other.elements))
1116625
def gap_subset(self, interval: Interval,
                   flexibility: int = 2) -> "IntervalList":
        
        return self.gaps().subset(interval, flexibility)
147702
def intersection(self, other):
        
        relative_position = self.relative_position_of(other)
        if relative_position in [
            self.RELATIVE_POSITION_PP_C,
            self.RELATIVE_POSITION_PI_LC,
            self.RELATIVE_POSITION_PI_LG,
            self.RELATIVE_POSITION_PI_CG,
            self.RELATIVE_POSITION_IP_B,
            self.RELATIVE_POSITION_II_LB,
        ]:
            return TimeInterval(begin=self.begin, end=self.begin)
        if relative_position in [
            self.RELATIVE_POSITION_IP_E,
            self.RELATIVE_POSITION_II_EG,
        ]:
            return TimeInterval(begin=self.end, end=self.end)
        if relative_position in [
            self.RELATIVE_POSITION_II_BI,
            self.RELATIVE_POSITION_II_BE,
            self.RELATIVE_POSITION_II_II,
            self.RELATIVE_POSITION_II_IE,
        ]:
            return TimeInterval(begin=other.begin, end=other.end)
        if relative_position in [
            self.RELATIVE_POSITION_IP_I,
            self.RELATIVE_POSITION_II_LI,
            self.RELATIVE_POSITION_II_LE,
            self.RELATIVE_POSITION_II_LG,
            self.RELATIVE_POSITION_II_BG,
            self.RELATIVE_POSITION_II_IG,
        ]:
            begin = max(self.begin, other.begin)
            end = min(self.end, other.end)
            return TimeInterval(begin=begin, end=end)
        return None
231234
def is_contradictory(self, other):
        
        other = self.coerce(other)
        to_i = self.to_i
        assert to_i(other.low) <= to_i(other.high), "Low must be <= high"
        if max(map(to_i, [other.low, self.low])) <= min(map(to_i, [other.high, self.high])):
            return False
        else:
            return True
867340
@SuppressWarnings("unchecked")
    public T overlap(final T otherInterval) {
        if (otherInterval == null) {
            return null;
        }
        if (otherInterval.isInfinite()) {
            return (T)this;
        }
        if (this.isInfinite()) {
            return otherInterval;
        }
        final Interval thisAsInterval = asInterval();
        final Interval otherAsInterval = otherInterval.asInterval();
        Interval overlap = thisAsInterval.overlap(otherAsInterval);
        if (overlap == null) {
            return null;
        }
        return newInterval(overlap);
    }
1270492
public boolean isIntersectingNE(Envelope2D other) {
		return ((xmin <= other.xmin) ? xmax >= other.xmin : other.xmax >= xmin)
				&& // check that x projections overlap
				((ymin <= other.ymin) ? ymax >= other.ymin : other.ymax >= ymin); // check
																					// that
																					// y
																					// projections
																					// overlap
	}
653007
def intersection(self, other):
        

        inter = MOC()

        for (order, cells) in other:
            for cell in cells:
                for i in self._compare_operation(order, cell, True, 'inter'):
                    inter.add(*i)

        return inter