Find the index of first non num element
320224
def get_not_num(self, seq, num=0):
        ''''''
        ind = next((i for i, x in enumerate(seq) if x != num), None)
        if ind == None:
            return self.board_size
        else:
            return ind
69402
function getIndex(item) {
            return isNumber(item) ? within(item, 0, items.length - 1) : item === undefined ? -1 : $items.index(item);
        }
510145
function(el, fromIndex /* = @[*-1] */){
      var O      = toIObject(this)
        , length = toLength(O.length)
        , index  = length - 1;
      if(arguments.length > 1)index = Math.min(index, toInteger(fromIndex));
      if(index < 0)index = toLength(length + index);
      for(;index >= 0; index--)if(index in O)if(O[index] === el)return index;
      return -1;
    }
1130900
def first(self, n=1):
        
        res = self.obj[0:n]
        if len(res) is 1:
            res = res[0]
        return self._wrap(res)
1134203
def positionIf(pred, seq):
    
    for i,e in enumerate(seq):
        if pred(e):
            return i
    return -1
1314249
def find_nearest_index(arr, value):
    """"""
    arr = np.array(arr)
    index = (abs(arr-value)).argmin()
    return index
426283
def nth(self, index):
        
        self.__prepare()
        return None if self.count() < math.fabs(index) else self._json_data[index]
815733
private long getIndex(T x, T y) {
        int i = elementIndices.index(x);
        int j = elementIndices.index(y);
        long index = (((long)i) << 32) | j;
        return index;
    }
533373
function indexOf(array, searchElement, fromIndex)
    {
        fromIndex = Math.max(fromIndex || 0, 0);

        for (var i = fromIndex; i < array.length; i++)
            if(array[i] == searchElement)
                return i;

        return -1;
    }
994012
function getNth (elements, target) {
  var length = elements.length
  var count = 0
  for (var index = 0; index < length; index++) {
    var element = elements[index]
    if (!element.hasOwnProperty('deleted')) {
      if (count === target) {
        return index
      }
      count++
    }
  }
  return (index + 1)
}
426842
def nth_char(char_map, index):
    """"""
    for char in char_map:
        if index < char_map[char]:
            return char
        index = index - char_map[char]
    return None
1014598
def index_next_crossing(value, array, starting_index=0, direction=1):
    

    for n in range(starting_index, len(array)-1):
        if  (value-array[n]  )*direction >= 0         \
        and (value-array[n+1])*direction <  0: return n

    # no crossing found
    return -1
690632
def index element
      rv = 0
      found = @element.find do |child|
        child.kind_of? Element and
        (rv += 1) and
        child == element
      end
      return rv if found == element
      return -1
    end
1269914
function(first, second) {
			var start = 0;
			var max = 0;

			for (var i = 0; i < first.length; i++) {
				for (var j = 0; j < second.length; j++) {
					var x = 0;
					while (first[i + x] === second[j + x]) {
						x++;
						if ((i + x >= first.length) || (j + x >= second.length)) {
							break;
						}
					}
					if (x > max) {
						max = x;
						start = i;
					}
				}
			}

			return first.slice(start, start + max);
		}
1172181
function(x) {
            	var index = null, n = this.elements.length;
            	for (var i = 0; i < n; i++) {
            	    if (index === null && this.elements[i] == x) {
            		index = i + 1;
            	    }
            	}
            	return index;
                }
209968
private static int lastIndexOf(Object o, Object[] elements, int index) {
        if (o == null) {
            for (int i = index; i >= 0; i--)
                if (elements[i] == null)
                    return i;
        } else {
            for (int i = index; i >= 0; i--)
                if (o.equals(elements[i]))
                    return i;
        }
        return -1;
    }
848106
function(item, index) {
                var n = this.length,
                        i = ~~index
                if (i < 0)
                    i += n
                for (; i < n; i++)
                    if (this[i] === item)
                        return i
                return -1
            }