Retrieve the element at the specified index.
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));
    }
781644
public Object set(int index, Object element) {

        Node   setMe   = getInternal(index);
        Object oldData = setMe.data;

        setMe.data = element;

        return oldData;
    }
1322464
public CSTNode get(int index, boolean safe) {
        CSTNode element = get(index);

        if (element == null && safe) {
            element = Token.NULL;
        }

        return element;
    }
1339446
def get_by_index(self, index):
        """"""

        try:
            return self[index]
        except KeyError:
            for v in self.get_volumes():
                if v.index == str(index):
                    return v
        raise KeyError(index)
328279
public JsonElement get(int index) throws JsonException {
        try {
            JsonElement value = values.get(index);
            if (value == null) {
                throw new JsonException("Value at " + index + " is null.");
            }
            return value;
        } catch (IndexOutOfBoundsException e) {
            throw new JsonException("Index " + index + " out of range [0.." + values.size() + ")");
        }
    }
1047017
public <T> T get(int index) {
        if (size() <= index) {
            return null;
        }
        return (T) args.get(index);
    }
309390
def getRowByIndex(self, index):
        
        assert isinstance(index, int)
        return Row(self._impl.getRowByIndex(index))
1195768
def get(self, key, value):
        """"""
        for element in self.neoindex[key][value]:
            if self.indexClass == "vertex":
                yield Vertex(element)
            elif self.indexClass == "edge":
                yield Edge(element)
            else:
                raise TypeError(self.indexClass)
160079
public JsonElement opt(int index) {
        if (index < 0 || index >= values.size()) {
            return null;
        }
        return values.get(index);
    }
481293
def get(self, selector, index=0, default=None):
        
        elements = self(selector)
        if elements:
            try:
                return elements[index]
            except (IndexError):
                pass
        return default
1095237
public function getElement($index)
    {
        return (array_key_exists((int) $index, $this->elements) ? $this->elements[$index] : null);
    }
1045044
def find_by_index(self, cls, index_name, value):
        """"""
        return self._find(cls, {index_name: str(value)})
1114650
def getitem(self, index, context=None):
        
        return _container_getitem(self, self.elts, index, context=context)
1012935
def SelectByIndex(cls, index):
        ''' 
        '''
        try:
            Select(cls._element()).select_by_index(int(index))
        except:
            return False
355455
public function get_element($index)
    {
        $count = $this->count();

        if (!$count) {
            return null;
        }

        // first element
        if ($index === 0 || $index === '0' || $index === 'FIRST') {
            preg_match('/^([0-9]+)/', $this->raw_data, $m);
            $result = (int) $m[1];
            return $result;
        }

        // last element
        if ($index === 'LAST' || $index == $count-1) {
            preg_match('/([0-9]+)$/', $this->raw_data, $m);
            $result = (int) $m[1];
            return $result;
        }

        // do we know the position of the element or the neighbour of it?
        if (!empty($this->meta['pos'])) {
            $element = preg_quote(self::SEPARATOR_ELEMENT, '/');
            $item    = preg_quote(self::SEPARATOR_ITEM, '/') . '[0-9]+' . preg_quote(self::SEPARATOR_LEVEL, '/') .'?';
            $regexp  = '(' . $element . '|' . $item . ')';

            if (isset($this->meta['pos'][$index])) {
                if (preg_match('/([0-9]+)/', $this->raw_data, $m, null, $this->meta['pos'][$index]))
                    $result = $m[1];
            }
            else if (isset($this->meta['pos'][$index-1])) {
                // get chunk of data after previous element
                $data = substr($this->raw_data, $this->meta['pos'][$index-1]+1, 50);
                $data = preg_replace('/^[0-9]+/', '', $data); // remove UID at $index position
                $data = preg_replace("/^$regexp/", '', $data); // remove separator
                if (preg_match('/^([0-9]+)/', $data, $m))
                    $result = $m[1];
            }
            else if (isset($this->meta['pos'][$index+1])) {
                // get chunk of data before next element
                $pos  = max(0, $this->meta['pos'][$index+1] - 50);
                $len  = min(50, $this->meta['pos'][$index+1]);
                $data = substr($this->raw_data, $pos, $len);
                $data = preg_replace("/$regexp\$/", '', $data); // remove separator

                if (preg_match('/([0-9]+)$/', $data, $m))
                    $result = $m[1];
            }

            if (isset($result)) {
                return (int) $result;
            }
        }

        // Finally use less effective method
        $data = $this->get();

        return $data[$index];
    }
1282432
public Element<T> getElement( int index , boolean fromFront ) {
		if( index > size || index < 0 ) {
			throw new IllegalArgumentException("index is out of bounds");
		}
		if( fromFront ) {
			Element<T> e = first;
			for( int i = 0; i < index; i++ ) {
				e = e.next;
			}
			return e;
		} else {
			Element<T> e = last;
			for( int i = 0; i < index; i++ ) {
				e = e.previous;
			}
			return e;
		}
	}
527890
public Object opt( int index ) {
      return (index < 0 || index >= size()) ? null : this.elements.get( index );
   }