/* Get the end of a project which starts at character
`fromIndex` in `value`.
343632
function project(value, fromIndex) {
  var index = fromIndex
  var length = value.length
  var size

  while (index < length) {
    if (!projectCharacter(value.charCodeAt(index))) {
      break
    }

    index++
  }

  size = fromIndex - index

  if (
    !size ||
    size > MAX_PROJECT_LENGTH ||
    value.slice(index - GIT_SUFFIX.length, index) === GIT_SUFFIX
  ) {
    return -1
  }

  return index
}
686752
public void setFinish(int index, Date value)
   {
      set(selectField(AssignmentFieldLists.CUSTOM_FINISH, index), value);
   }
931418
function username(value, fromIndex) {
  var index = fromIndex
  var length = value.length
  var size

  /* First character of username cannot be a dash. */
  if (value.charCodeAt(index) === CC_DASH) {
    return -1
  }

  while (index < length) {
    if (!usernameCharacter(value.charCodeAt(index))) {
      break
    }

    index++
  }

  size = index - fromIndex

  /* Last character of username can no longer be a dash, but could be (GH-13). */
  if (!size || size > MAX_USER_LENGTH) {
    return -1
  }

  return index
}
226493
@SuppressWarnings("unused")
    private int findEndOfNowikiGreedy (int startBlock) {
        // NOTE: this method could step back one char from startBlock position
        int nextBlock=startBlock-3;
        do {
            do {
                nextBlock=wikiText.indexOf("{{{", nextBlock+3);
            } while (nextBlock>0 && wikiChars[nextBlock-1]=='~');
            if (nextBlock<0) nextBlock=wikiLength;
            int endBlock=wikiText.lastIndexOf("}}}", nextBlock);
            if (endBlock>=startBlock && wikiChars[endBlock-1]!='~') return endBlock;
        } while (nextBlock<wikiLength);
        return wikiLength;
    }
1243860
def _hole_end(self, position, ignore=None):
        
        for rindex in range(position, self.max_end):
            for starting in self.starting(rindex):
                if not ignore or not ignore(starting):
                    return rindex
        return self.max_end
466613
def find_rep_end(self, text):
        ''''''
        return self.find_end(text, self.start_rep_token, self.end_rep_token, ignore_end_token=self.end_var_token)
609823
public void get1Value(int index, float[] valueDestination) {
        try {
            SFVec2f sfVec2f = value.get(index);
            valueDestination[0] = sfVec2f.x;
            valueDestination[1] = sfVec2f.y;
        }
        catch (IndexOutOfBoundsException e) {
            Log.e(TAG, "X3D MFVec2f get1Value(index) out of bounds." + e);
        }
        catch (Exception e) {
            Log.e(TAG, "X3D MFVec2f get1Value(index) exception " + e);
        }
    }
660675
function locateRepoReference(value, fromIndex) {
  var hash = value.indexOf('@', fromIndex)
  var issue = value.indexOf('#', fromIndex)
  var index
  var start
  var test

  if (hash === -1) {
    index = issue
  } else if (issue === -1) {
    index = hash
  } else {
    index = hash > issue ? issue : hash
  }

  start = index

  if (start === -1) {
    return index
  }

  while (index >= fromIndex) {
    if (!repoCharacter(value.charCodeAt(index - 1))) {
      break
    }

    index--
  }

  if (index < start && index >= fromIndex) {
    test = start === hash ? hexadecimal : decimal

    if (
      test(value.charCodeAt(start + 1)) &&
      !repoCharacter(value.charCodeAt(index - 1))
    ) {
      return index
    }
  }

  /* Find the next possible value. */
  return locateRepoReference(value, start + 1)
}
1303256
private void closeValueLength(int value, int index) {
    int initialValue = toIntUnsigned(getValue(index));
    setLength(index, (short) (value - initialValue));
  }
1205314
def _get_end_index(self):
        """"""
        return max(self.index + self.source_window,
                   self._get_target_index() + self.target_window)
329971
public int lastIndexOf(final char ch, int startIndex) {
        startIndex = (startIndex >= size ? size - 1 : startIndex);
        if (startIndex < 0) {
            return -1;
        }
        for (int i = startIndex; i >= 0; i--) {
            if (buffer[i] == ch) {
                return i;
            }
        }
        return -1;
    }
1351585
function slice(start, end) {
    var index = -1,
        object = Object(this),
        length = object.length >>> 0,
        result = [];

    start = toInteger(start);
    start = start < 0 ? max(length + start, 0) : min(start, length);
    start--;
    end = end == null ? length : toInteger(end);
    end = end < 0 ? max(length + end, 0) : min(end, length);

    while ((++index, ++start) < end) {
      if (start in object) {
        result[index] = object[start];
      }
    }
    return result;
  }
344551
public static boolean endsWith(final String value, final String search, final boolean caseSensitive) {
        validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
        return endsWith(value, search, value.length(), caseSensitive);
    }
614493
function getValue(fromObject, fromKey) {
  var regDot = /\./g
    , regFinishArray = /.+(\[\])/g
    , keys
    , key
    , result
    , lastValue
    ;

  keys = fromKey.split(regDot);
  key = keys.splice(0, 1);

  result = _getValue(fromObject, key[0], keys);

  return handleArrayOfUndefined_(result);
}
639042
private int findEndOfLine(final ByteBuf buffer) {
        int totalLength = buffer.readableBytes();
        int i = buffer.forEachByte(buffer.readerIndex() + offset, totalLength - offset, ByteProcessor.FIND_LF);
        if (i >= 0) {
            offset = 0;
            if (i > 0 && buffer.getByte(i - 1) == '\r') {
                i--;
            }
        } else {
            offset = totalLength;
        }
        return i;
    }
956823
private static int js_lastIndexOf(String target, Object[] args) {
        String search = ScriptRuntime.toString(args, 0);
        double end = ScriptRuntime.toNumber(args, 1);

        if (end != end || end > target.length())
            end = target.length();
        else if (end < 0)
            end = 0;

        return target.lastIndexOf(search, (int)end);
    }
615551
function endsWith(str, prefix) {
  return (str.indexOf(prefix, str.length - prefix.length) !== -1);
}