Get index value of the record and set new id value in the array

@param inArr sub array of data
@param outArr array of sub data
@return current index value of the sub data
182994
private int setSecDataArr(ArrayList inArr, ArrayList outArr) {

        if (!inArr.isEmpty()) {
            for (int j = 0; j < outArr.size(); j++) {
                if (outArr.get(j).equals(inArr)) {
                    return j + 1;
                }
            }
            outArr.add(inArr);
            return outArr.size();
        } else {
            return 0;
        }
    }
345899
public static void intIndexesToBooleanArray(int[] arra, boolean[] arrb) {

        for (int i = 0; i < arra.length; i++) {
            if (arra[i] < arrb.length) {
                arrb[arra[i]] = true;
            }
        }
    }
709029
public static long[] getArrowStrides(INDArray arr) {
        long[] ret = new long[arr.rank()];
        for(int i = 0; i < arr.rank(); i++) {
            ret[i] = arr.stride(i) * arr.data().getElementSize();
        }

        return ret;
    }
512976
@Override
    public INDArray get(INDArrayIndex... indexes) {
        //check for row/column vector and point index being 0
        if (indexes.length == 1 && indexes[0] instanceof NDArrayIndexAll || (indexes.length == 2 && (isRowVector()
                        && indexes[0] instanceof PointIndex && indexes[0].offset() == 0
                        && indexes[1] instanceof NDArrayIndexAll
                        || isColumnVector() && indexes[1] instanceof PointIndex && indexes[0].offset() == 0
                                        && indexes[0] instanceof NDArrayIndexAll)))
            return this;

        indexes = NDArrayIndex.resolve(javaShapeInformation, indexes);

        throw new UnsupportedOperationException("Not implemeted");
    }
792819
@NonNull
    @Override
    public MutableArray setNumber(int index, Number value) {
        return setValue(index, value);
    }
1042522
def index(idx)
      unless (0...length).cover? idx
        raise IndexError, "Index #{idx} outside of bounds 0..#{length - 1}"
      end

      ptr = GirFFI::InOutPointer.new element_type, data_ptr + idx * element_size
      ptr.to_ruby_value
    end
946202
public static INDArray lastIndex(INDArray array, Condition condition, int... dimension) {
        if (!(condition instanceof BaseCondition))
            throw new UnsupportedOperationException("Only static Conditions are supported");

        return Nd4j.getExecutioner().exec(new LastIndex(array, condition, dimension));
    }
792473
static int indexOfSerial(final double[] incr, final double v) {
		int index = -1;
		for (int i = 0; i < incr.length && index == -1; ++i) {
			if (incr[i] >= v) {
				index = i;
			}
		}

		return index;
	}
142933
public Record getRecordAt(int i) 
    {
        i -= DBConstants.MAIN_FIELD;    // Zero based index
        try   {
            return (Record)this.elementAt(i);
        } catch (ArrayIndexOutOfBoundsException e)  {
        }
        return null;    // Not found
    }
1233641
public Rec setDataIndex(int iNodeIndex, Rec record)
    {
        if (record != null)
        {
            if (RESET_INDEX == iNodeIndex)
            {
                m_recTargetFieldList = record;
                if ((this.getNodeType() == MessageRecordDesc.NON_UNIQUE_NODE)
                    && (!this.isSingleDetail(record)))
                        record = this.createSubDataRecord(record);
            }
            else if (END_OF_NODES == iNodeIndex)
            {
                if (!this.isCurrentDataRecord(record))
                {
                    record = this.updateRecord(record, false);
                    record.free();
                }
                m_recTargetFieldList = null;
            }
            else
            {
                if (!this.isCurrentDataRecord(record))
                {
                    record = this.updateRecord(record, false);
                    if (record != null)
                    {
                        try
                        {
                            if (record.getTable().hasNext())
                            {
                                record = (Rec)record.getTable().next();
                                if (record != null)
                                    if (m_recTargetFieldList != null)
                                        if (record.getTableNames(false).equalsIgnoreCase(m_recTargetFieldList.getTableNames(false)))
                                            if (record.getTable().getHandle(0).equals(m_recTargetFieldList.getTable().getHandle(0)))
                                                if (m_recTargetFieldList.isModified())
                                            {   // I just read the same record as the target, make sure I have the current copy
                                                super.setDataIndex(iNodeIndex, record); // Set the node index before returning
                                                return m_recTargetFieldList;
                                            }
                            }
                            else
                                record = null;  // EOF
                        } catch (DBException ex) {
                            ex.printStackTrace();
                            record = null;
                        }
                    }
                }
            }
        }

        return super.setDataIndex(iNodeIndex, record);
    }
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;
        }
    }
1272620
public DataBuffer getIndicesOf(int i) {
        int from = underlyingRank() * i;
        int to = from + underlyingRank(); //not included

        int[] arr = new int[rank];
        int j = 0; // iterator over underlying indices
        int k = 0; //iterator over hiddenIdx
        for (int dim = 0; dim < rank; dim++) {
            if (k < hiddenDimensions().length && hiddenDimensions()[k] == j) {
                arr[dim] = 0;
                k++;
            } else {
                arr[dim] = indices.getInt(j);
                j++;
            }
        }
        return Nd4j.getDataBufferFactory().createInt(arr);
    }
977071
public static INDArrayIndex[] createFromStartAndEnd(INDArray start, INDArray end) {
        if (start.length() != end.length())
            throw new IllegalArgumentException("Start length must be equal to end length");
        else {
            if (start.length() > Integer.MAX_VALUE)
                throw new ND4JIllegalStateException("Can't proceed with INDArray with length > Integer.MAX_VALUE");

            INDArrayIndex[] indexes = new INDArrayIndex[(int) start.length()];
            for (int i = 0; i < indexes.length; i++) {
                indexes[i] = NDArrayIndex.interval(start.getInt(i), end.getInt(i));
            }
            return indexes;
        }
    }
711414
public static CitationIDIndexPair fromJson(List<?> arr) {
		String citationId = (String)arr.get(0);
		int noteIndex = ((Number)arr.get(1)).intValue();
		return new CitationIDIndexPair(citationId, noteIndex);
	}
782653
@Override
    public int iamin(INDArray arr) {
        if (arr.isSparse()) {
            return Nd4j.getSparseBlasWrapper().level1().iamin(arr);
        } else {
            throw new UnsupportedOperationException();
        }
    }
261112
private static long toArrayIndex(String id)
    {
        long index = toArrayIndex(ScriptRuntime.toNumber(id));
        // Assume that ScriptRuntime.toString(index) is the same
        // as java.lang.Long.toString(index) for long
        if (Long.toString(index).equals(id)) {
            return index;
        }
        return -1;
    }
790983
function Outpoint(hash, index) {
  if (!(this instanceof Outpoint))
    return new Outpoint(hash, index);

  this.hash = encoding.NULL_HASH;
  this.index = 0xffffffff;

  if (hash != null) {
    assert(typeof hash === 'string', 'Hash must be a string.');
    assert(util.isU32(index), 'Index must be a uint32.');
    this.hash = hash;
    this.index = index;
  }
}