Get/set look ahead set
@param mixed
@return mixed
551720
function lookahead( $la = null ){
		$a = $this->la;
		if( ! is_null($la) ){
			$this->la = $la;
		}
		return $a;
	}
1149507
public function getPrevious($step = 1) {
      $position = ($this->position - $step);
      return isset($this->items[$position]) ? $this->items[$position] : null;
    }
736
public function get($condition)
    {
        $result = null;
        $this->hook->attach('collection.get.before', $condition, $result, $this);

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

        if (!is_array($condition)) {
            $condition = array('collection_id' => $condition);
        }

        $condition['limit'] = array(0, 1);
        $list = (array) $this->getList($condition);
        $result = empty($list) ? array() : reset($list);

        $this->hook->attach('collection.get.after', $condition, $result, $this);
        return $result;
    }
195534
public function getForeground($name)
    {
        if (array_key_exists($name, $this->foreground)) {
            return $this->foreground[$name];
        }

        return false;
    }
1326191
function shift() {
        if(\count($this->queue) === 0) {
            return false;
        }
        
        $item = \array_shift($this->queue);
        
        $this->get()->then(function ($data) {
            $data['remaining']--;
            
            return $this->set($data);
        })->done(null, array($this->api->client, 'handlePromiseRejection'));
        
        return $item;
    }
413721
public function getFirst()
    {
        $varReturn = null;
        if (count($this->collection) > 0) {
            $varReturn = $this->collection[0];
        }

        return $varReturn;
    }
757790
public function offsetGet($offset)
    {
        $val = $this->registry->getEntry($offset, null);
        if (empty($val)) {
            $val = $this->_getFallbackMethod($offset, array(), false, 'get');
        }
        return $val;
    }
1198816
public function get()
    {
         // run the callbacks to retirve the results
        $results = $this->executeResultFetcher();

        // we always exprect an array here!
        if (!is_array($results) || empty($results))
        {
            $results = array();
        }

        // In case we should forward a key means using a value
        // from every result as array key.
        if ((!empty($results)) && $this->forwardKey !== false && is_string($this->forwardKey)) 
        {
            $rawResults = $results;
            $results = array();

            // check if the collection is beeing fetched 
            // as an associated array 
            if (!is_array(reset($rawResults)))
            {
                throw new Exception('Cannot forward key, the result is no associated array.');
            }

            foreach ($rawResults as $result) 
            {
                $results[$result[$this->forwardKey]] = $result;
            }
        }

        // Group the resuls by a items value
        if ((!empty($results)) && $this->groupResults !== false && is_string($this->groupResults)) 
        {
            $rawResults = $results;
            $results = array();

            // check if the collection is beeing fetched 
            // as an associated array 
            if (!is_array(reset($rawResults)))
            {
                throw new Exception('Cannot forward key, the result is no associated array.');
            }

            foreach ($rawResults as $key => $result) 
            {
                $results[$result[$this->groupResults]][$key] = $result;
            }
        }

        // when the limit is specified to exactly one result we
        // return directly that one result instead of the entire array
        if ($this->limit === 1) 
        {
            $results = reset($results);
        }

        return $results;
    }
1140416
public function get_set($folder)
    {
        foreach ($this->sets as $set) {
            if ($set->get_parameters('MAILBOX') == $folder) {
                return $set;
            }
        }

        return false;
    }
503092
public function prev() {
        $condition = [$this->rightAttribute => $this->owner->getAttribute($this->leftAttribute) - 1];
        $this->applyTreeAttributeCondition($condition);

        return $this->owner->find()->andWhere($condition);
    }
699879
public function lookup($key)
    {
        if ($this->member($key) === false) {
            return Maybe::nothing();
        }

        $copy = array_merge($this->value);

        return Maybe::just($copy[$key]);
    }
96636
public function forward($p)
    {
        $lon = $p->x;
        $lat = $p->y;

        $dlon = Common::adjust_lon($lon - $this->long0);

        $x;
        $y;

        if (abs($lat) <= Common::EPSLN) {
            $x = $this->x0 + $this->R * $dlon;
            $y = $this->y0;
        }

        $theta = Common::asinz(2.0 * abs( $lat / Common::PI));

        if ((abs($dlon) <= Common::EPSLN) || (abs(abs($lat) - Common::HALF_PI) <= Common::EPSLN)) {
            $x = $this->x0;

            if ($lat >= 0) {
                $y = $this->y0 + Common::PI * $this->R * tan(0.5 * $theta);
            } else {
                $y = $this->y0 + Common::PI * $this->R * - tan(0.5 * $theta);
            }
            //  return(OK);
        }

        $al = 0.5 * abs((Common::PI / $dlon) - ($dlon / Common::PI));
        $asq = $al * $al;

        $sinth = sin($theta);
        $costh = cos($theta);

        $g = $costh / ($sinth + $costh - 1.0);
        $gsq = $g * $g;
        $m = $g * (2.0 / $sinth - 1.0);
        $msq = $m * $m;

        $con = Common::PI
            * $this->R
            * ($al * ($g - $msq) + sqrt($asq * ($g - $sq) * ($g - $msq) - ($msq + $asq) * ($gsq - $msq) )) / ($msq + $asq);

        if ($dlon < 0) {
            $con = -$con;
        }

        $x = $this->x0 + $con;
        $con = abs( $con / (Common::PI * $this->R) );

        if ($lat >= 0) {
            $y = $this->y0 + Common::PI * $this->R * sqrt(1.0 - $con * $con - 2.0 * $al * $con);
        } else {
            $y = $this->y0 - Common::PI * $this->R * sqrt(1.0 - $con * $con - 2.0 * $al * $con);
        }

        $p->x = $x;
        $p->y = $y;

        return $p;
    }
872290
public function getForwardFunction()
    {
        if ($this->forwardFunction)
            return $this->forwardFunction;
        if ($this->getParent())
            return $this->getParent()->getForwardFunction();
        return null;
    }
92281
public function setServerSet()
    {
        $set = $this->config->get('server.set', []);
        $this->workerNum = $set['worker_num'] ?? 0;
        $this->taskNum = $set['task_worker_num'] ?? 0;
        return $set;
    }
312188
protected function presetValue()
    {
        if ($this->encoding) {
            return $this->encoding->preset;
        }

        if ($this->preset) {
            return $this->preset;
        }

        return array_keys(config('decoy.encode.presets'))[0];
    }
431006
public function get($handle)
    {
        $this->setting = $this->items->where('handle', $handle)->first();

        return $this->setting;
    }
809378
public function lookahead($number = 1)
    {
        $fetch = $number - count($this->stash);

        while ($fetch-- > 0) {
            $this->stash[] = $this->next();
        }

        return $this->stash[--$number];
    }