Getting the nth element of the collection

        :@param index
        :@type index: int

        :@return object
426283
def nth(self, index):
        
        self.__prepare()
        return None if self.count() < math.fabs(index) else self._json_data[index]
1364949
@Pure
	public P getElementAt(int index) {
		if (index >= 0) {
			int idx = 0;
			int eIdx;
			for (final GridCell<P> cell : getGridCells()) {
				eIdx = idx + cell.getReferenceElementCount();
				if (index < eIdx) {
					try {
						return cell.getElementAt(index - idx);
					} catch (IndexOutOfBoundsException exception) {
						throw new IndexOutOfBoundsException(Integer.toString(index));
					}
				}
				idx = eIdx;
			}
		}
		throw new IndexOutOfBoundsException(Integer.toString(index));
	}
460727
T get(long index) {
        checkRange(index);

        if (checkSubRange(index)) {
            // cannot exceed Integer.MAX_VALUE (checked by checkSubRange)
            return subList.get((int) (index - subListOffset));
        }
        return null;
    }
760899
public E get(long index) {
        // @@@ can further optimize by caching last seen spineIndex,
        // which is going to be right most of the time

        // Casts to int are safe since the spine array index is the index minus
        // the prior element count from the current spine
        if (spineIndex == 0) {
            if (index < elementIndex)
                return curChunk[((int) index)];
            else
                throw new IndexOutOfBoundsException(Long.toString(index));
        }

        if (index >= count())
            throw new IndexOutOfBoundsException(Long.toString(index));

        for (int j=0; j <= spineIndex; j++)
            if (index < priorElementCount[j] + spine[j].length)
                return spine[j][((int) (index - priorElementCount[j]))];

        throw new IndexOutOfBoundsException(Long.toString(index));
    }
629934
function nth(list, indexNum) {
    if (arguments.length == 1) {
      // Manually currying
      indexNum = list;
      return (list) => nth(list, indexNum);
    }

    if(indexNum >= 0) {
      return list[+indexNum]
    };
    return [...list].reverse()[list.length+indexNum];
  }
979138
@Override
    public T get(int index) {
        /* Check that this is a valid index. */
        if (index < 0 || index >= size())
            throw new IndexOutOfBoundsException("Index " + index + ", size " + size());

        /* Look up the element. */
        return mArrays[computeOffset(index)][computeIndex(index)];
    }
495414
def nth(index)
			if (!index.kind_of?(Integer))
				raise ArgumentError, "Expected an Integer for 'index' but got a #{index.class}."
			elsif (index >= self.len)
				return nil
			end
			return IPv4.new(self.network.addr + index)
		end
137091
public Object getAt(int index) {
        try {
            // a negative index will count backwards from the last column.
            if (index < 0)
                index += result.size();
            Iterator it = result.values().iterator();
            int i = 0;
            Object obj = null;
            while ((obj == null) && (it.hasNext())) {
                if (i == index)
                    obj = it.next();
                else
                    it.next();
                i++;
            }
            return obj;
        }
        catch (Exception e) {
            throw new MissingPropertyException(Integer.toString(index), GroovyRowResult.class, e);
        }
    }
1202456
public T set(int index, T element)
    {
        switch (index)
        {
            case 0:
                T previousElement1 = this.element1;
                this.element1 = element;
                return previousElement1;
            case 1:
                T previousElement2 = this.element2;
                this.element2 = element;
                return previousElement2;
            default:
                throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + this.size());
        }
    }
926613
public static Object getElementFromCollection(Collection<Object> collection, int index) {
    if (collection.size() < index + 1)
      return null;

    if (collection instanceof List)
      return ((List<Object>) collection).get(index);

    Iterator<Object> iterator = collection.iterator();
    for (int i = 0; i < index; i++) {
      iterator.next();
    }
    return iterator.next();
  }
195066
@Override
	public MaybeNode get(int index) {
		if (index == 0) {
			final OMElement first = element.getFirstElement();
			return factory().newNode(first,
					pathBuilder().withPart("any").atIndex(0));
		}
		return NodeFactory.noneNode(pathBuilder().atIndex(index));
	}
776981
public int get(int index) {
        if (d_bitsPerElem == 0)
            return 0;

        int startIdx = (index * d_bitsPerElem) / INT_SIZE;
        int startBit = (index * d_bitsPerElem) % INT_SIZE;

        int result = (d_data[startIdx] >>> startBit) & MASK[d_bitsPerElem];

        if ((startBit + d_bitsPerElem) > INT_SIZE) {
            int done = INT_SIZE - startBit;
            result |= (d_data[startIdx + 1] & MASK[d_bitsPerElem - done]) << done;
        }

        return result;
    }
527890
public Object opt( int index ) {
      return (index < 0 || index >= size()) ? null : this.elements.get( index );
   }
440927
public Object get (int index)
    {
        return _list[(_lastPos-index-1+_list.length)%_list.length];
    }
309390
def getRowByIndex(self, index):
        
        assert isinstance(index, int)
        return Row(self._impl.getRowByIndex(index))
429113
public T get( int index ) {
		if( index >= size )
			throw new IllegalArgumentException("Index out of bounds: index "+index+" size "+size);
		return data[index];
	}
69581
public T findElement(By by, int index) {
        T element = null;
        List<T> elements = findElements(by);
        if (elements.size() > index) {
            element = elements.get(index);
        }
        return element;
    }