Merges any overlapping intervals.

        Args:
            also_remove_contiguous: treat contiguous (as well as overlapping)
                intervals as worthy of merging?
779638
def remove_overlap(self, also_remove_contiguous: bool = False) -> None:
        
        overlap = True
        while overlap:
            overlap = self._remove_overlap_sub(also_remove_contiguous)
        self._sort()
123021
def within(self, other: "Interval", inclusive: bool = True) -> bool:
        
        if not other:
            return False
        if inclusive:
            return self.start >= other.start and self.end <= other.end
        else:
            return self.start > other.start and self.end < other.end
1066177
public void merge(GridConfiguration other) {
    if (other == null) {
      return;
    }
    super.merge(other);

    if (isMergeAble(Integer.class, other.cleanUpCycle, cleanUpCycle)) {
      cleanUpCycle = other.cleanUpCycle;
    }
    if (isMergeAble(Map.class, other.custom, custom)) {
      if (custom == null) {
        custom = new HashMap<>();
      }
      custom.putAll(other.custom);
    }
    if (isMergeAble(Integer.class, other.maxSession, maxSession) &&
        other.maxSession > 0) {
      maxSession = other.maxSession;
    }
    if (isMergeAble(List.class, other.servlets, servlets)) {
      servlets = other.servlets;
    }
    if (isMergeAble(List.class, other.withoutServlets, withoutServlets)) {
      withoutServlets = other.withoutServlets;
    }
  }
1228954
def remove(self, interval):
        
        # since this is a list, called methods can set this to [1],
        # making it true
        done = []
        return self.remove_interval_helper(interval, done, should_raise_error=True)
21456
def is_contiguous(self):
        ''''''
        previous = None
        for index in self.indexes:
            if previous is None:
                previous = index
                continue

            if index != (previous + 1):
                return False

            previous = index

        return True
424283
def merge(self, other):
        
        newstart = min(self._start, other.start)
        newend = max(self._end, other.end)
        return Range(newstart, newend)
1331641
def merge(self, others, merge_conditions, common_ancestor=None):
        
        merging_occurred = False

        for o in others:
            for region_id, region in o._regions.items():
                if region_id in self._regions:
                    merging_occurred |= self._regions[region_id].merge(
                        [region], merge_conditions, common_ancestor=common_ancestor
                    )
                else:
                    merging_occurred = True
                    self._regions[region_id] = region

        return merging_occurred
1191625
def merge(self, other):
        
        
        for key in other.keys():
            if key not in self:
                # copies over both lower and higher dimensional data
                self[key] = other[key]
1177291
def _tidy(self) -> None:
        
        if self.no_overlap:
            self.remove_overlap(self.no_contiguous)  # will sort
        else:
            self._sort()
881969
def overlapbatch(args):
    
    p = OptionParser(overlap.__doc__)
    opts, args = p.parse_args(args)
    if len(args) != 2:
        sys.exit(not p.print_help())

    ctgfasta, poolfasta = args
    f = Fasta(ctgfasta)
    for k, rec in f.iteritems_ordered():
        fastafile = k + ".fasta"
        fw = open(fastafile, "w")
        SeqIO.write([rec], fw, "fasta")
        fw.close()

        overlap([fastafile, poolfasta])
1111379
def merge(self, other):
        
        other = IntervalCell.coerce(other)
        if self.is_equal(other):
            # pick among dependencies
            return self
        elif other.is_entailed_by(self):
            return self
        elif self.is_entailed_by(other):
            self.low, self.high = other.low, other.high
        elif self.is_contradictory(other):
            #import traceback
            #for line in traceback.format_stack(): print line.strip()

            raise Contradiction("Cannot merge [%0.2f, %0.2f] with [%0.2f, %0.2f]" \
                    % (self.low, self.high, other.low, other.high))
        else:
            # information in both
            self.low = max(self.low, other.low)
            self.high = min(self.high, other.high)
        return self
145612
def overlap(self, other):
        """"""
        if self._start < other.end and self._end > other.start:
            return True
        return False
999697
def merge(self, other):
        
        ignore = self.ignore
        extra = self.extras
        if isinstance(other, Dict):
            other_keys = other.keys
            ignore += other.ignore
            extra += other.extras
        elif isinstance(other, (list, tuple)):
            other_keys = list(other)
        elif isinstance(other, dict):
            return self.__class__(other, *self.keys)
        else:
            raise TypeError('You must merge Dict only with Dict'
                            ' or list of Keys')
        return self.__class__(*(self.keys + other_keys), ignore_extra=ignore,
                              allow_extra=extra)
1325535
def merge(self, buffer, other_hyper_log_log):
        

        for i in range(len(buffer)):
            buffer[i] = max(buffer[i], other_hyper_log_log[i])
777843
def overlapping(start1, end1, start2, end2):
    
    return not ((start1 <= start2 and start1 <= end2 and end1 <= end2 and end1 <= start2) or
                (start1 >= start2 and start1 >= end2 and end1 >= end2 and end1 >= start2))
481658
def remove(self, first, count):
        

        # Avoid trivialities
        if first < 0 or count < 1:
            return

        new_range = []
        last = first + count - 1
        for r in self.__range:
            if first <= r.last and r.first <= last:
                # There is an overlap
                if r.first < first:
                    new_range.append(IdRange(r.first, first-r.first))
                if last < r.last:
                    new_range.append(IdRange(last+1, r.last-last))
            else:
                # No overlap, range is kept
                new_range.append(r)

        self.__range = new_range
1038772
def merge(a, b):
    
    _check_steps(a, b)
    return range(min(a.start, b.start), max(a.stop, b.stop))