- (id) fleeceValueToObjectAtIndex: (NSUInteger)index
12969
private Object fleeceValueToObject(int index) {
        check(index);
        final FLValue value = values.get(index);
        if (value == null) { return null; }
        final MRoot root = new MRoot(context, value, false);
        synchronized (rs.getQuery().getDatabase().getLock()) {
            return root.asNative();
        }
    }
683645
@Override
    public Blob getBlob(int index) {
        check(index);
        final Object obj = fleeceValueToObject(index);
        return obj instanceof Blob ? (Blob) obj : null;
    }
77661
function _toNaturalIndex (idx, len) {
    idx = _toInteger(idx);

    return idx >= -len && idx < len ? idx < 0 ? idx + len : idx : NaN;
}
309167
def str_byte_index(haystack, needle, offset = 0)

      result = nil
      mb_idx = haystack.index(needle, offset)

      unless mb_idx.nil?

        if mb_idx < 1
          result = 0
        else
          matched = haystack.slice(0..mb_idx)
          result  = matched.bytesize - matched[-1].bytesize
        end
      end

      result
    end
745788
function(target, index, val, clone) {

            if (isNaN(index) && index != "first" && index != "last") {
                error(index + 'is not a valid index.');
                return;
            }

            var type = objType(target),
                length = target.length;

            //to limit index
            var idx = index < 0 || index == "first" ? 0 : index > length || index == "last" ? length : index;


            //if array push
            if (type == 'array') {
                val = clone ? jsonQ.clone(val) : val;
                target.splice(idx, 0, val);
            }

            //if string concatenate , if number add
            else if (type == 'string') {
                target = target.substring(0, idx) + val + target.substring(idx, length);
            }


            return target;

        }
900596
private void addAtIndex(int index, PropertySource<?> propertySource) {
        removeIfPresent(propertySource);
        this.propertySourceList.add(index, propertySource);
    }
132159
def g(self, id):
        
        if id not in self._m:
            if self.orig_ids:
                self._m[id] = id
                if self.warn:
                    try:
                        int(id)
                    except:
                        sys.stderr.write(
                            'Warning: ID "%s" is not an integer.\n' % id)
                        self.warn = False
            else:
                self._m[id] = self.index
                self.index += 1
        return self._m[id]
1177360
@NonNull
    @Override
    public MutableArray setValue(int index, Object value) {
        synchronized (lock) {
            if (Fleece.valueWouldChange(value, internalArray.get(index), internalArray)
                && (!internalArray.set(index, Fleece.toCBLObject(value)))) {
                throwRangeException(index);
            }
            return this;
        }
    }
615411
int getChainUserIndex(int chain, int index) {
		int i = getChainIndex_(chain);
		AttributeStreamOfInt32 stream = m_chainIndices.get(index);
		if (stream.size() <= i)
			return -1;
		return stream.read(i);
	}
1372948
@NonNull
    @Override
    public MutableArray addValue(Object value) {
        synchronized (lock) {
            internalArray.append(Fleece.toCBLObject(value));
            return this;
        }
    }
398391
def getextensibleindex(bunchdt, data, commdct, key, objname):
    """"""
    theobject = getobject(bunchdt, key, objname)
    if theobject == None:
        return None
    theidd = iddofobject(data, commdct, key)
    extensible_i = [
        i for i in range(len(theidd)) if 'begin-extensible' in theidd[i]]
    try:
        extensible_i = extensible_i[0]
    except IndexError:
        return theobject
1048362
static String toStringIdOrIndex(Context cx, Object id)
    {
        if (id instanceof Number) {
            double d = ((Number)id).doubleValue();
            int index = (int)d;
            if (index == d) {
                storeIndexResult(cx, index);
                return null;
            }
            return toString(id);
        }
        String s;
        if (id instanceof String) {
            s = (String)id;
        } else {
            s = toString(id);
        }
        long indexTest = indexFromString(s);
        if (indexTest >= 0) {
            storeIndexResult(cx, (int)indexTest);
            return null;
        }
        return s;
    }
299909
private int indexOf(ApptentiveNotificationObserver observer) {
		for (int i = 0; i < observers.size(); ++i) {
			final ApptentiveNotificationObserver other = observers.get(i);
			if (other == observer) {
				return i;
			}

			final ObserverWeakReference otherReference = ObjectUtils.as(other, ObserverWeakReference.class);
			if (otherReference != null && otherReference.get() == observer) {
				return i;
			}
		}
		return -1;
	}
1006685
static Object getIndexObject(double d)
    {
        int i = (int)d;
        if (i == d) {
            return Integer.valueOf(i);
        }
        return toString(d);
    }
804533
@Override
  public int mustFindValueFor(final int slotNo) {
    final int index = find(auxIntArr, lgAuxArrInts, lgConfigK, slotNo);
    if (index >= 0) {
      return HllUtil.getValue(auxIntArr[index]);
    }
    throw new SketchesStateException("SlotNo not found: " + slotNo);
  }
321240
def getAppRefByBundleId(cls, bundleId):
        
        ra = AppKit.NSRunningApplication
        # return value (apps) is always an array. if there is a match it will
        # have an item, otherwise it won't.
        apps = ra.runningApplicationsWithBundleIdentifier_(bundleId)
        if len(apps) == 0:
            raise ValueError(('Specified bundle ID not found in '
                            'running apps: %s' % bundleId))
        pid = apps[0].processIdentifier()
        return cls.getAppRefByPid(pid)
888350
function( object, propertyTable, eid ) {

		// Create a new BST for this entity for by-value matching
		if (this.indexVal[eid] === undefined)
			this.indexVal[eid] = new BinarySearchTree({
				compareKeys: objectBstComparison,
				checkValueEquality: objectBstEquals,
				unique: true,
			});

		// Keep object references
		var nid = this.indexRef.length;
		this.indexVal[eid].insert( propertyTable, nid );
		this.indexRef.push( object );

		// Keep ID on the object itself so we have a faster lookup,
		// and do it in a non-enumerable property so it doesn't pollute the objects.
		Object.defineProperty(
			object, "__iref__", {
				enumerable: false,
				value: nid,
			}
		);

	}