Queue pages to load within the given range such that
proceeding pages are added before preceding pages
@param  {int} range The range to load beyond the current page
@returns {void}
426830
function (range) {
            var currentIndex = layoutState.page - 1;
            if (range > 0) {
                range = calculateRange(range);
                // load pages in the order of priority based on the direction
                // the user is scrolling (load nearest page first, working in
                // the scroll direction, then start on the opposite side of
                // scroll direction and work outward)
                // NOTE: we're assuming that a negative scroll direction means
                // direction of previous pages, and positive is next pages...
                if (scrollDirection >= 0) {
                    queuePagesToLoadInOrder(currentIndex + 1, range.max);
                    queuePagesToLoadInOrder(currentIndex - 1, range.min);
                } else {
                    queuePagesToLoadInOrder(currentIndex - 1, range.min);
                    queuePagesToLoadInOrder(currentIndex + 1, range.max);
                }
            }
        }
1144597
function(range) {
			if (this.overlap(range)) {
				var start = Math.max(range.start, this.start);
				var end = Math.min(range.end, this.end);
				return new Range(start, end - start);
			}
			
			return null;
		}
1335988
def add_range(self, start, stop, step=1, pad=0):
        
        assert start < stop, "please provide ordered node index ranges"
        assert step > 0
        assert pad >= 0
        assert stop - start < 1e9, "range too large"

        if pad > 0 and self.padding is None:
            self.padding = pad
        set.update(self, range(start, stop, step))
269287
function (data) {
            if (!ready) {
                return;
            }
            var i;
            if (data.all === true) {
                data.upto = numPages;
            }
            if (data.page) {
                this.queuePageToLoad(data.page - 1);
            } else if (data.upto) {
                for (i = 0; i < data.upto; ++i) {
                    this.queuePageToLoad(i);
                }
            }
        }
247623
function paginate (num, page) {
  num = num || 50;
  page = page - 1 || 0;
  const pageStart = num * page;
  const pageEnd = pageStart + num;
  return R.slice(pageStart, pageEnd);
}
86783
function createRange(el, selection) {

  var start = selection.start;
  var end = selection.end;

  var range = document.createRange();

  var i = iterator(el.firstChild, el);

  var next = i.node;
  var isClosing = false;

  var count = 0;
  var length;

  while (next) {

    if (count === start) {
      if (isClosing) {
        range.setStartAfter(next);
      } else {
        range.setStartBefore(next);
      }
    }

    if (count === end) {
      if (isClosing) {
        range.setEndAfter(next);
      } else {
        range.setEndBefore(next);
      }

      return range;
    }

    if (!isClosing) {
      if (
        isBr(next) || (
          next.previousSibling && (
            isDiv(next) ||
            isParagraph(next)
          )
        )
      ) {
        count++;
      }
    }

    if (isText(next)) {

      length = next.textContent.length;

      if (count <= start && count + length > start) {
        range.setStart(next, start - count);
      }

      if (count + length > end) {
        range.setEnd(next, end - count);

        return range;
      }

      count += length;
    }

    next = i.next();
    isClosing = i.closingTag;
  }

  // out of range
  if (count <= start) {
    if (el.lastChild) {
      range.setStartAfter(el.lastChild);
    } else {
      range.setStart(el, 0);
    }
  }

  if (el.lastChild) {
    range.setEndAfter(el.lastChild);
  } else {
    range.setEnd(el, 0);
  }

  return range;
}
439169
public void addTransientRange(String id, RowRange range) {
    String start = DatatypeConverter.printHexBinary(range.getStart().toArray());
    String end = DatatypeConverter.printHexBinary(range.getEnd().toArray());

    appConfig.setProperty(PREFIX + id, start + ":" + end);
  }
204129
function (range) {
            var cells = this.getCells(range);
            UETable.addSelectedClass(cells);
            this.selectedTds = cells;
            this.cellsRange = range;
        }
372227
function pageLoadLoop() {
        var index;
        clearTimeout(pageLoadTID);
        if (pageLoadQueue.length > 0) {
            // found a page to load
            index = pageLoadQueue.shift();
            // page exists and not reached max errors?
            if (pages[index]) {
                api.loadPage(index, function loadPageCallback(pageIsLoading) {
                    if (pageIsLoading === false) {
                        // don't wait if the page is not loading
                        pageLoadLoop();
                    } else {
                        pageLoadTID = setTimeout(pageLoadLoop, PAGE_LOAD_INTERVAL);
                    }
                });
            } else {
                pageLoadLoop();
            }
        } else {
            stopPageLoadLoop();
        }
    }
56252
function(sel, range) {
            var ranges = sel.getAllRanges();
            sel.removeAllRanges();
            for (var i = 0, len = ranges.length; i < len; ++i) {
                if (!rangesEqual(range, ranges[i])) {
                    sel.addRange(ranges[i]);
                }
            }
            if (!sel.rangeCount) {
                updateEmptySelection(sel);
            }
        }
1365309
function selectRange(range, window) {
      var selection = window.getSelection();
      selection.removeAllRanges();
      selection.addRange(range);
    }
912709
def append(self, first, count):
        

        self.__range.append(IdRange(first, count))
1038506
function () {
            var me = this;
            return new Range(me.document).setStart(me.startContainer, me.startOffset).setEnd(me.endContainer, me.endOffset);

        }
347646
function Range(min, max, step) {
  var scope = null
    , re = /^([A-Za-z]|\d+)\.{2}([A-Za-z]|\d+)$/;

  if (typeof min === 'string' && min.match(re)) {
    step = max;
    scope = min.split('..');
    min = cast(scope[0]);
    max = cast(scope[1]);
  }

  this.min(min);
  this.max(max);
  this.step(step);
}
534634
function updateRanges(resources, start, delays) {
    for(var i = 0, len = resources.length; i < len; i++) {
      var res = resources[i];
      if(res.range[1] > start) continue;

      if(res.subRanges) {
        updateRanges(res.subRanges, start, {});
        setEarliestSubRange(res);
      }
      else {
        res.range = rMap[res.id].next(start);

        if(res.id !== '_proj' && !delays[res.id]) {
          delays[res.id] = { needed: start, available: res.range[0] };
        }
      }
    }
  }
152051
function range(start, stop, step) {
  if (start != null && typeof start != 'number') {
    throw new Error('start must be a number or null');
  }
  if (stop != null && typeof stop != 'number') {
    throw new Error('stop must be a number or null');
  }
  if (step != null && typeof step != 'number') {
    throw new Error('step must be a number or null');
  }
  if (stop == null) {
    stop = start || 0;
    start = 0;
  }
  if (step == null) {
    step = stop > start ? 1 : -1;
  }
  var toReturn = [];
  var increasing = start < stop; //← here’s the change
  for (; increasing ? start < stop : start > stop; start += step) {
    toReturn.push(start);
  }
  return toReturn;
}
1226491
private void processRanges(List<DateRange> ranges, ProjectCalendarDateRanges container)
   {
      if (ranges != null)
      {
         for (DateRange range : ranges)
         {
            container.addRange(range);
         }
      }
   }