Shortcut for add(Interval(begin, end, data)).

        Completes in O(log n) time.
547471
def addi(self, begin, end, data=None):
        
        return self.add(Interval(begin, end, data))
1308835
function calculateTimeIntervals(timeColumn) {
  // First we find the last time for all of the data (this is an optomisation for the calculateAvailability operation.
  const endTime = timeColumn.values.reduce(function(latest, value, index) {
    const current = finishFromIndex(timeColumn, index);
    if (
      !defined(latest) ||
      (defined(current) && JulianDate.greaterThan(current, latest))
    ) {
      return current;
    }
    return latest;
  }, finishFromIndex(timeColumn, 0));

  return timeColumn.values.map(function(value, index) {
    return calculateAvailability(timeColumn, index, endTime);
  });
}
200166
function finishFromIndex(timeColumn, index) {
  if (!defined(timeColumn.displayDuration)) {
    return timeColumn.finishJulianDates[index];
  } else {
    return JulianDate.addMinutes(
      timeColumn.julianDates[index],
      timeColumn.displayDuration,
      endScratch
    );
  }
}
1236974
public void setInterval(ReadableInstant start, ReadableInstant end) {
        if (start == null && end == null) {
            long now = DateTimeUtils.currentTimeMillis();
            setInterval(now, now);
        } else {
            long startMillis = DateTimeUtils.getInstantMillis(start);
            long endMillis = DateTimeUtils.getInstantMillis(end);
            Chronology chrono = DateTimeUtils.getInstantChronology(start);
            super.setInterval(startMillis, endMillis, chrono);
        }
    }
289051
synchronized void add(Write write) {
        Exceptions.checkNotClosed(this.closed, this);
        this.writes.addLast(write);
        this.totalLength += write.data.getLength();
        write.setQueueAddedTimestamp(this.timeSupplier.get());
    }
136163
function startIdle() {
        var idleCount = 0;

        function idle() {

            coordinates.push({
                t: 1,
                x: lastX,
                y: lastY
            });
            idleCount++;
            if (idleCount > 10) {
                clearInterval(idleInterval);
            }
        }
        idle();
        idleInterval = setInterval(idle, 1000);
    }
235839
void insert_data(Any any, TimeVal t)
	{
		if (size()>=max_elt)
			remove(0);
		add(new RingElt(any, t));
	}
910908
def finalize(self, sched):
        """"""
        super(AddCoro, self).finalize(sched)
        return self.result
248040
function wait(times, interval, callback) {
        Delay.setEditorTimeout(editor, function () {
          resize({});

          if (times--) {
            wait(times, interval, callback);
          } else if (callback) {
            callback();
          }
        }, interval);
      }
1017647
def add(self, interval):
        
        if interval in self:
            return

        if interval.is_null():
            raise ValueError(
                "IntervalTree: Null Interval objects not allowed in IntervalTree:"
                " {0}".format(interval)
            )

        if not self.top_node:
            self.top_node = Node.from_interval(interval)
        else:
            self.top_node = self.top_node.add(interval)
        self.all_intervals.add(interval)
        self._add_boundaries(interval)
765783
def add_interval(self, precision=0):
        
        precision = precision or self.precision
        interval = round((self._stop - self._start), precision)
        self.intervals.append(interval)
        self._intervals_len += 1
        self._start = time.perf_counter()
        return self.format_time(interval)
97546
def add_thread(self, func, interval):
        
        t = Thread(func, interval, self.output_dict)
        t.start()
        self._thread_pool.append(t)
1291282
def insert_completions(self, e): # (M-*)
        """
        completions = self._get_completions()
        b = self.begidx
        e = self.endidx
        for comp in completions:
            rep = [ c for c in comp ]
            rep.append(' ')
            self.l_buffer[b:e] = rep
            b += len(rep)
            e = b
        self.line_cursor = b    
        self.finalize()
1220483
def chop(self, begin, end, datafunc=None):
        
        insertions = set()
        begin_hits = [iv for iv in self.at(begin) if iv.begin < begin]
        end_hits = [iv for iv in self.at(end) if iv.end > end]

        if datafunc:
            for iv in begin_hits:
                insertions.add(Interval(iv.begin, begin, datafunc(iv, True)))
            for iv in end_hits:
                insertions.add(Interval(end, iv.end, datafunc(iv, False)))
        else:
            for iv in begin_hits:
                insertions.add(Interval(iv.begin, begin, iv.data))
            for iv in end_hits:
                insertions.add(Interval(end, iv.end, iv.data))

        self.remove_envelop(begin, end)
        self.difference_update(begin_hits)
        self.difference_update(end_hits)
        self.update(insertions)
804726
def _append_to_data_parts(self, data, start, end):
        '''
        
        '''
        try:
            while data[start] == ' ':
                start += 1

            if start == end:
                end = len(data[start:])

            self.string_parts.append(data[start:end])
        except KeyboardInterrupt as e:
            raise e
        except Exception:
            try:
                self.string_parts.append(data[start:])
            except KeyboardInterrupt as e:
                raise e
            except Exception:
                pass

        return start
1048101
def containsi(self, begin, end, data=None):
        
        return Interval(begin, end, data) in self
1199908
@Override
    public CompletableFuture<Void> add(Operation operation, Duration timeout) {
        ensureRunning();
        return this.operationProcessor.process(operation);
    }