Returns the head of the queue, then cycles it to the back of the queue.
432574
T cycle() {
        if (_prioritize != null) {
            return _prioritize;
        }
        if (!_queue.isEmpty()) {
            T first = _queue.keySet().iterator().next();
            _queue.get(first);  // Access the object so it gets bumped to the back of the queue.
            return first;
        }
        return null;
    }
592236
def _get_queue(self):
        
        if self._queue is None:
            self._links = []
            queue, depth = self._resolve_queue(self.queue, links=self._links)
            if queue is None and depth > 0:
                raise QueueLinkBroken
            self._queue = queue
        return self._queue
185185
def _obtain_queue(num_jobs):
    
    if _should_use_multiprocessing(num_jobs):
        return ReprQueue(multiprocessing.Manager().Queue())

    return ReprQueue(Queue())
563412
function () {
      var tail = this._tail
        , head = this._head;
      for (var i = tail; i < head; i++) {
        var entry = this._byOrder[i];
        if (entry) {
          this._tail = i;
          return entry;
        }
      }
    }
680316
def head(self, file_path):
        
        processor = lambda path, node, tail_only=True, append=False: self._handle_head(
            path, node)

        # Find items and go
        for item in self._client._find_items([file_path], processor,
                                             include_toplevel=True,
                                             include_children=False, recurse=False):
            if item:
                return item
711298
function() {
			var forkContext = this.forkContext;

			if (forkContext.reachable) {
				getThrowContext(this).thrownForkContext.add(forkContext.head);
				forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
			}
		}
663447
function() {
			var context = this.choiceContext;

			this.choiceContext = context.upper;

			var forkContext = this.forkContext;
			var headSegments = forkContext.head;

			switch (context.kind) {
				case "&&":
				case "||":

					/*
					 * If any result were not transferred from child contexts,
					 * this sets the head segments to both cases.
					 * The head segments are the path of the right-hand operand.
					 */
					if (!context.processed) {
						context.trueForkContext.add(headSegments);
						context.falseForkContext.add(headSegments);
					}

					/*
					 * Transfers results to upper context if this context is in
					 * test chunk.
					 */
					if (context.isForkingAsResult) {
						var parentContext = this.choiceContext;

						parentContext.trueForkContext.addAll(context.trueForkContext);
						parentContext.falseForkContext.addAll(context.falseForkContext);
						parentContext.processed = true;

						return context;
					}

					break;

				case "test":
					if (!context.processed) {

						/*
						 * The head segments are the path of the `if` block here.
						 * Updates the `true` path with the end of the `if` block.
						 */
						context.trueForkContext.clear();
						context.trueForkContext.add(headSegments);
					} else {

						/*
						 * The head segments are the path of the `else` block here.
						 * Updates the `false` path with the end of the `else`
						 * block.
						 */
						context.falseForkContext.clear();
						context.falseForkContext.add(headSegments);
					}

					break;

				case "loop":

					/*
					 * Loops are addressed in popLoopContext().
					 * This is called from popLoopContext().
					 */
					return context;

					/* istanbul ignore next */
				default:
					throw new Error("unreachable");
			}

			// Merges all paths.
			var prevForkContext = context.trueForkContext;

			prevForkContext.addAll(context.falseForkContext);
			forkContext.replaceHead(prevForkContext.makeNext(0, -1));

			return context;
		}
697505
private E firstDataItem() {
        for (Node p = head; p != null; p = succ(p)) {
            Object item = p.item;
            if (p.isData) {
                if (item != null && item != p)
                    return LinkedTransferQueue.<E>cast(item);
            }
            else if (item == null)
                return null;
        }
        return null;
    }
790488
public function head()
    {
        $query = $this->getCriteria();

        $args = func_get_args();
        if(empty($args)){
            $args = null;
        }

        $response = '';

        try {
            $response = $this->client->request($this, 'head', $args, array(), $query);
        } catch(Exception $ex) {
            $this->dispatchException($ex);
        }

        return $this->transformResponse($response, true);
    }
389319
def reverse_list(head):
    
    if not head or not head.next:
        return head
    prev = None
    while head:
        current = head
        head = head.next
        current.next = prev
        prev = current
    return prev
1058597
function () {
        while (this.head !== null) {
            var temp = this.head;
            this.head = this.head.next();   // use next() the instead of "_next", otherwise it will loop forever
            temp._list = null;
            temp._next = null;
            temp._prev = null;
        }

        this.head = null;
        this.size = 0;
    }
989714
public T head() {
        int index = iter.nextIndex();
        if (index >= list.size()) {
            throw new NoSuchElementException();
        } else {
            return list.get(index);
        }
    }
797773
def head(self, url, **kwargs):
        

        kwargs.setdefault('allow_redirects', True)
        return self.request('head', url, **kwargs)
825586
def head_object_async(self, path, **kwds):
    
    return self.do_request_async(self.api_url + path, 'HEAD', **kwds)
1240603
def head(self, url: StrOrURL, *, allow_redirects: bool=False,
             **kwargs: Any) -> '_RequestContextManager':
        """"""
        return _RequestContextManager(
            self._request(hdrs.METH_HEAD, url,
                          allow_redirects=allow_redirects,
                          **kwargs))
1220464
def head(self, limit=25, **fetch_kwargs):
        
        return self.fetch(order_by="KEY", limit=limit, **fetch_kwargs)
61535
public function poll()
    {
        if ($this->count() === 0) {
            return null;
        }

        $head = $this[$this->index];

        unset($this[$this->index]);
        $this->index++;

        return $head;
    }