Helper function. Writes ranges of completed ticks and updates them to include the expanded range
Called from withing a synchronized (this) block.
@param completedRanges List of TickRange objects representing ranges to write
188314
private final void doWriteCompletedRanges(List completedRanges)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "doWriteCompletedRanges",
        new Object[] { completedRanges });

    int length = completedRanges.size();
    for (int i=0; i<length; i++)
    {
      completedRanges.set(i, stream.writeCompletedRange((TickRange) completedRanges.get(i)));
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "doWriteCompletedRanges");
  }
986997
private void addHours(ProjectCalendarDateRanges ranges, Record hoursRecord)
   {
      if (hoursRecord.getValue() != null)
      {
         String[] wh = hoursRecord.getValue().split("\\|");
         try
         {
            String startText;
            String endText;

            if (wh[0].equals("s"))
            {
               startText = wh[1];
               endText = wh[3];
            }
            else
            {
               startText = wh[3];
               endText = wh[1];
            }

            // for end time treat midnight as midnight next day
            if (endText.equals("00:00"))
            {
               endText = "24:00";
            }
            Date start = m_calendarTimeFormat.parse(startText);
            Date end = m_calendarTimeFormat.parse(endText);

            ranges.addRange(new DateRange(start, end));
         }
         catch (ParseException e)
         {
            // silently ignore date parse exceptions
         }
      }
   }
327926
public static List<Long> starts(final Iterable<Range<Long>> ranges) {
        List<Long> starts = new ArrayList<Long>();
        for (Range<Long> range : ranges) {
            checkClosedOpen(range);
            starts.add(range.lowerEndpoint());
        }
        return starts;
    }
152789
public void setRangesOnIndexedValues(java.util.Collection<ObjectAttributeRange> rangesOnIndexedValues) {
        if (rangesOnIndexedValues == null) {
            this.rangesOnIndexedValues = null;
            return;
        }

        this.rangesOnIndexedValues = new java.util.ArrayList<ObjectAttributeRange>(rangesOnIndexedValues);
    }
961081
public final void finished()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "finished");

        synchronized(_subCursors)
        {
            for (int priority = Priorities.LOWEST_PRIORITY; priority <= Priorities.HIGHEST_PRIORITY; priority++)
            {
                if (null != _subCursors[priority])
                {
                    _subCursors[priority].finished();
                    _subCursors[priority] = null;
                }
            }
        }
        _owningList._removeCursor(this);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "finished");
    }
1346879
private void appendColumnRange(ColumnRange colRange) {
        if (last == null) {
            first = colRange;
            last = colRange;
        } else {
            last.setNext(colRange);
            last = colRange;
        }
    }
17568
public static <T> void setEndFrames(List<? extends Keyframe<T>> keyframes) {
    int size = keyframes.size();
    for (int i = 0; i < size - 1; i++) {
      // In the json, the keyframes only contain their starting frame.
      Keyframe<T> keyframe = keyframes.get(i);
      Keyframe<T> nextKeyframe = keyframes.get(i + 1);
      keyframe.endFrame = nextKeyframe.startFrame;
      if (keyframe.endValue == null && nextKeyframe.startValue != null) {
        keyframe.endValue = nextKeyframe.startValue;
        if (keyframe instanceof PathKeyframe) {
          ((PathKeyframe) keyframe).createPath();
        }
      }
    }
    Keyframe<?> lastKeyframe = keyframes.get(size - 1);
    if ((lastKeyframe.startValue == null || lastKeyframe.endValue == null) && keyframes.size() > 1) {
      // The only purpose the last keyframe has is to provide the end frame of the previous
      // keyframe.
      //noinspection SuspiciousMethodCalls
      keyframes.remove(lastKeyframe);
    }
  }
69099
public void write(Collection<? extends MapLayer> layers) throws IOException {
		if (this.progression != null) {
			this.progression.setProperties(0, 0, layers.size() + 1, false);
		}

		// Write the header
		if (!this.isHeaderWritten) {
			this.isHeaderWritten = true;
			writeHeader();
		}

		if (this.progression != null) {
			this.progression.increment();
		}

		final ObjectOutputStream oos = new ObjectOutputStream(this.tmpOutput);
		for (final MapLayer layer : layers) {
			oos.writeObject(layer);
			++this.length;
			if (this.progression != null) {
				this.progression.increment();
			}
		}
		if (this.progression != null) {
			this.progression.end();
		}
	}
584117
def _update_consumed_ranges(self, start_pos, end_pos):
        
        self.range_set.add(Interval(start_pos, end_pos+1))
        self.range_set.merge_overlaps()
1093522
@Override
  public synchronized void write(final Collection<BatchPoints> collection) {
    // empty the cached data first
    ListIterator<BatchPoints> batchQueueIterator = batchQueue.listIterator();
    while (batchQueueIterator.hasNext()) {
      BatchPoints entry = batchQueueIterator.next();
      WriteResult result = tryToWrite(entry);
      if (result.outcome == WriteResultOutcome.WRITTEN
              || result.outcome == WriteResultOutcome.FAILED_RETRY_IMPOSSIBLE) {
        batchQueueIterator.remove();
        usedRetryBufferCapacity -= entry.getPoints().size();
        // we are throwing out data, notify the client
        if (result.outcome == WriteResultOutcome.FAILED_RETRY_IMPOSSIBLE) {
          exceptionHandler.accept(entry.getPoints(), result.throwable);
        }
      } else {
        // we cannot send more data otherwise we would write them in different
        // order than in which were submitted
        for (BatchPoints batchPoints : collection) {
          addToBatchQueue(batchPoints);
        }
        return;
      }
    }
    // write the last given batch last so that duplicate data points get overwritten correctly
    Iterator<BatchPoints> collectionIterator = collection.iterator();
    while (collectionIterator.hasNext()) {
      BatchPoints batchPoints = collectionIterator.next();
      WriteResult result = tryToWrite(batchPoints);
      switch (result.outcome) {
        case FAILED_RETRY_POSSIBLE:
          addToBatchQueue(batchPoints);
          while (collectionIterator.hasNext()) {
            addToBatchQueue(collectionIterator.next());
          }
          break;
        case FAILED_RETRY_IMPOSSIBLE:
          exceptionHandler.accept(batchPoints.getPoints(), result.throwable);
          break;
        default:

      }
    }
  }
42237
public void setRange(final double RANGE) {
        this.range = RANGE;
        checkForBlips();
        init(getInnerBounds().width, getInnerBounds().height);
        repaint();
    }
387416
function combineRanges (ranges) {
  var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart)

  for (var j = 0, i = 1; i < ordered.length; i++) {
    var range = ordered[i]
    var current = ordered[j]

    if (range.start > current.end + 1) {
      // next range
      ordered[++j] = range
    } else if (range.end > current.end) {
      // extend range
      current.end = range.end
      current.index = Math.min(current.index, range.index)
    }
  }

  // trim ordered array
  ordered.length = j + 1

  // generate combined range
  var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex)

  // copy ranges type
  combined.type = ranges.type

  return combined
}
328187
def _finalize_ticks(self, axis, element, xticks, yticks, zticks):
        
        yalignments = None
        if xticks is not None:
            ticks, labels, yalignments = zip(*sorted(xticks, key=lambda x: x[0]))
            xticks = (list(ticks), list(labels))
        super(BarPlot, self)._finalize_ticks(axis, element, xticks, yticks, zticks)
        if yalignments:
            for t, y in zip(axis.get_xticklabels(), yalignments):
                t.set_y(y)
96093
public void setCounters(java.util.Collection<SummarizedCounter> counters) {
        if (counters == null) {
            this.counters = null;
            return;
        }

        this.counters = new java.util.ArrayList<SummarizedCounter>(counters);
    }
81271
private static Iterator<RoaringBitmap> selectRangeWithoutCopy(final 
      Iterator<? extends RoaringBitmap> bitmaps,
      final long rangeStart, final long rangeEnd) {
    Iterator<RoaringBitmap> bitmapsIterator;
    bitmapsIterator = new Iterator<RoaringBitmap>() {
      @Override
      public boolean hasNext() {
        return bitmaps.hasNext();
      }

      @Override
      public RoaringBitmap next() {
        RoaringBitmap next = bitmaps.next();
        return selectRangeWithoutCopy(next, rangeStart, rangeEnd);
      }

      @Override
      public void remove() {
        throw new UnsupportedOperationException("Remove not supported");
      }
    };
    return bitmapsIterator;
  }
972980
private void writeLogEntries(Iterable<LogEntry> logEntries, WriteOption... writeOptions) {
    switch (this.writeSynchronicity) {
      case SYNC:
        get(writeAsync(logEntries, writeOptions));
        break;

      case ASYNC:
      default:
        final ApiFuture<Void> writeFuture = writeAsync(logEntries, writeOptions);
        final Object pendingKey = new Object();
        pendingWrites.put(pendingKey, writeFuture);
        ApiFutures.addCallback(
            writeFuture,
            new ApiFutureCallback<Void>() {
              private void removeFromPending() {
                pendingWrites.remove(pendingKey);
              }

              @Override
              public void onSuccess(Void v) {
                removeFromPending();
              }

              @Override
              public void onFailure(Throwable t) {
                try {
                  Exception ex = t instanceof Exception ? (Exception) t : new Exception(t);
                  throw new RuntimeException(ex);
                } finally {
                  removeFromPending();
                }
              }
            });
        break;
    }
  }
657601
function addRange(start, finish, scope) {
                var i = 0;
                for (i = start; i <= finish; i++) {
                    var item = {
                        value: $sce.trustAsHtml(i.toString()),
                        liClass: scope.page == i ? scope.activeClass : 'waves-effect',
                        action: function() {
                            internalAction(scope, this.value);
                        }
                    };

                    scope.List.push(item);
                }
            }