Calls toFirst, but considers start and end bounds.
968181
private boolean toBoundedFirst() throws FetchException {
        if (mStartBound == null) {
            if (!toFirst()) {
                return false;
            }
        } else {
            if (!toFirst(mStartBound.clone())) {
                return false;
            }
            if (!mInclusiveStart) {
                byte[] currentKey = getCurrentKey();
                if (currentKey == null) {
                    return false;
                }
                if (compareKeysPartially(mStartBound, currentKey) == 0) {
                    if (!toNextKey()) {
                        return false;
                    }
                }
            }
        }

        if (mEndBound != null) {
            byte[] currentKey = getCurrentKey();
            if (currentKey == null) {
                return false;
            }
            int result = compareKeysPartially(currentKey, mEndBound);
            if (result >= 0) {
                if (result > 0 || !mInclusiveEnd) {
                    return false;
                }
            }
        }

        return prefixMatches();
    }
671669
function check_bounds(buf, offset, len) {
    if (offset < 0 || offset + len > buf.length) {
        throw new RangeError("Index out of range");
    }
}
1217028
def _calculate_bounds(self):
        """"""
        # get start datetime
        first = self.coll_handle.find_one(None, sort=[("ts", ASCENDING)])
        last = self.coll_handle.find_one(None, sort=[("ts", DESCENDING)])

        self._start = first['ts']
        if self._start.tzinfo is None:
            self._start = self._start.replace(tzinfo=tzutc())

        self._end = last['ts']
        if self._end.tzinfo is None:
            self._end = self._end.replace(tzinfo=tzutc())

        return True
459536
function validateStartEnd(start, end) {
  if (!start || !start.isValid) {
    return new Invalid("missing or invalid start");
  } else if (!end || !end.isValid) {
    return new Invalid("missing or invalid end");
  } else if (end < start) {
    return new Invalid(
      "end before start",
      `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`
    );
  } else {
    return null;
  }
}
602159
def op_range(self, start, end):
        
        while start < end:
            yield start
            start += instruction_size(self.code[start], self.opc)
218625
private int findFirst(CharSequence input, int beginIndex, int rewindIndex) {
        int first = -1;
        boolean atomBoundary = true;
        for (int i = beginIndex; i >= rewindIndex; i--) {
            char c = input.charAt(i);
            if (localAtomAllowed(c)) {
                first = i;
                atomBoundary = false;
            } else if (c == '.') {
                if (atomBoundary) {
                    break;
                }
                atomBoundary = true;
            } else {
                break;
            }
        }
        return first;
    }
184318
public synchronized void endInit() {
		if (win == null) return;
		progressText.setText("Starting framework...");
		progressBar.setMinimum(0);
		progressBar.setMaximum(10050);
		progressBar.setValue(50);
		bottom.invalidate();
	}
1098640
@SuppressWarnings("unchecked")
    public final T first(T defaultValue) {
        if (this instanceof Callable) {
            return checkedCall((Callable<T>) this);
        }
        Iterator<T> it = iterator();
        if (it.hasNext()) {
            return it.next();
        }
        return defaultValue;
    }
1151101
void linkFirst(final E e) {
    final E f = first;
    first = e;

    if (f == null) {
      last = e;
    } else {
      setPrevious(f, e);
      setNext(e, f);
    }
  }
186876
function () {
		this.resetBounds = function () {
			this.bounds = { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity };
		};
		this.resetBounds();
	}
680916
def first(self):
        
        self.params['limit'] = 1
        result = self.all()
        return result.items[0] if result.total > 0 else None
224593
final public void setOffset(Integer start, Integer end) {
    if ((start == null) || (end == null)) {
      // do nothing
    } else if (start > end) {
      throw new IllegalArgumentException("Start offset after end offset");
    } else {
      tokenOffset = new MtasOffset(start, end);
    }
  }
847038
def first(self):
        
        if self._first is None:
            for target in self.targets:
                if target is not None:
                    self._first = target
                    break
            else:
                self._first = False

        return self._first
1041548
private static long start(Range<Long> range) {
        if (range.lowerBoundType() == BoundType.OPEN) {
            return DiscreteDomain.longs().next(range.lowerEndpoint());
        } else {
            return range.lowerEndpoint();
        }
    }
89566
def set_bounds(self, start, stop):
        
        for instrument in self.instruments:
            instrument.bounds = (start, stop)
234124
public void setRange(int start, int end) {
    if (end < start || start < 0 || end > size) {
      throw new IllegalArgumentException();
    }
    if (end == start) {
      return;
    }
    end--; // will be easier to treat this as the last actually set bit -- inclusive
    int firstInt = start / 32;
    int lastInt = end / 32;
    for (int i = firstInt; i <= lastInt; i++) {
      int firstBit = i > firstInt ? 0 : start & 0x1F;
      int lastBit = i < lastInt ? 31 : end & 0x1F;
      // Ones from firstBit to lastBit, inclusive
      int mask = (2 << lastBit) - (1 << firstBit);
      bits[i] |= mask;
    }
  }
867279
private void descendingForEach(KTypePredicate<? super KType> predicate, int fromIndex, final int toIndex) {
    if (fromIndex == toIndex)
      return;

    final KType[] buffer = Intrinsics.<KType[]> cast(this.buffer);
    int i = toIndex;
    do {
      i = oneLeft(i, buffer.length);
      if (!predicate.apply(buffer[i])) {
        break;
      }
    } while (i != fromIndex);
  }