Return index of *item* in member list or -1 if not present.
354483
def _index(self, item):
        ''''''
        index = bisect.bisect_left(self._members, item)
        if index != len(self) and self._members[index] == item:
            return index

        return -1
866017
def count(self, item):
        """"""
        # pylint: disable=arguments-differ
        key, value = item
        return 1 if key in self._dict and self._dict[key] == value else 0
1042441
def _index_by_name(self, name):
        """"""
        for i, t in enumerate(self._cache):
            if t[2] == name:
                return i
            # END found item
        # END for each item in cache
        return -1
8279
def _getitem_normalized(self, index):
        """"""
        index = normalize_slice(len(self), index)
        counter = 0
        output = ''
        for fs in self.chunks:
            if index.start < counter + len(fs) and index.stop > counter:
                s_part = fs.s[max(0, index.start - counter):index.stop - counter]
                piece = Chunk(s_part, fs.atts).color_str
                output += piece
            counter += len(fs)
            if index.stop < counter:
                break
        return fmtstr(output)
1286848
def _getitem(self, key):
		""""""
		loc = self._bisect_right(key) - 1
		value = self._values[loc]
		if value is NOT_SET:
			raise KeyError(key)
		else:
			return value
1319208
def findPreviousItem(self, item):
        
        if not item:
            return None
        
        while item.parent():
            index = item.parent().indexOfChild(item)
            if index == 0:
                return item.parent()
            
            child = item.parent().child(index-1)
            if child:
                while child.childCount():
                    child = child.child(child.childCount() - 1)
                return child
            
            item = item.parent()
        
        index = self.indexOfTopLevelItem(item)
        out = self.topLevelItem(index-1)
        while out and out.childCount():
            out = out.child(out.childCount() - 1)
        return out
896381
def itemgetter(iterable, indexes):
    '''  '''
    indexes = indexes if isinstance(indexes, tuple) else tuple(indexes)
    assert all(isinstance(i, int) for i in indexes), 'indexes needs to be a tuple of ints'
    positive_indexes=[i for i in indexes if i>=0]
    negative_indexes=[i for i in indexes if i<0]
    out = {}
    if len(negative_indexes):
        # if there are any negative indexes
        negative_index_buffer = deque(maxlen=min(indexes)*-1)
        for i,x in enumerate(iterable):
            if i in positive_indexes:
                out[i]=x
            negative_index_buffer.append(x)
        out.update({ni:negative_index_buffer[ni] for ni in negative_indexes})
    else:
        # if just positive results
        out.update({i:x for i,x in enumerate(iterable) if i in positive_indexes})
    return itemgetter(*indexes)(out)
987057
def index(self, item, **kwargs):
        # type: (Any, dict) -> int
        
        return list.index(self, self.ref(item), **kwargs)
478397
public int indexOf( T obj ) {
		for (int i = 0; i < size; i++) {
			if( data[i].equals(obj) ) {
				return i;
			}
		}
		return -1;
	}
220034
function indexOf(list, element, comparator) {
			for (var i=0,item; item=list[i]; i++) {
				if (equals(item, element, comparator)) {
					return i;
				}
			}
			return -1;
		}
198697
def index(self, value):
        """"""
        try:
            diff = value - self._start
        except TypeError:
            raise ValueError('%r is not in range' % value)
        quotient, remainder = divmod(diff, self._step)
        if remainder == 0 and 0 <= quotient < self._len:
            return abs(quotient)
        raise ValueError('%r is not in range' % value)
393189
def get_index_nested(x, i):
    
    for ind in range(len(x)):
        if i == x[ind]:
            return ind
    return -1
1337234
def getitem(lst, indices):
    
    if not indices:
        return lst

    i, indices = indices[0], indices[1:]
    item = list.__getitem__(lst, i)

    if isinstance(i, int):
        return getitem(item, indices)

    # Empty slice: check if all subsequent indices are in range for the
    # full slice, raise IndexError otherwise. This is NumPy's behavior.
    if not item:
        if lst:
           _ = getitem(lst, (slice(None),) + indices)
        elif any(isinstance(k, int) for k in indices):
           raise IndexError
        return []

    return [getitem(x, indices) for x in item]
1206516
def find(self, header):
        
        header = header.lower()
        for idx, item in enumerate(self._headers):
            if item.lower() == header:
                return idx
        return -1
69402
function getIndex(item) {
            return isNumber(item) ? within(item, 0, items.length - 1) : item === undefined ? -1 : $items.index(item);
        }
1168848
def popitem(self):
        """"""
        if self._impl._items:
            i = self._impl._items.pop(0)
            self._impl.incr_version()
            return i[1], i[2]
        else:
            raise KeyError("empty multidict")
173453
def mget_list(item, index):
    ''
    if isinstance(index, (int, slice)):
        return item[index]
    else:
        return map(item.__getitem__, index)