Check that the head is connected.
@param optHead
422624
private void checkHead(Token token, Optional<Integer> optHead) {
        if (optHead.isPresent()) {
            int head = optHead.get();
            Preconditions.checkArgument(head >= 0 && head <= tokens.size(), String.format("Head should refer to token or 0: %s", token));
        }
    }
1062548
def _head(self, client_kwargs):
        
        return _handle_http_errors(
            self.client.request(
                'HEAD', timeout=self._TIMEOUT, **client_kwargs)).headers
289835
def explore_show_head(self, uri, check_headers=None):
        
        print("HEAD %s" % (uri))
        if (re.match(r'^\w+:', uri)):
            # Looks like a URI
            response = requests.head(uri)
        else:
            # Mock up response if we have a local file
            response = self.head_on_file(uri)
        print("  status: %s" % (response.status_code))
        if (response.status_code == '200'):
            # print some of the headers
            for header in ['content-length', 'last-modified',
                           'lastmod', 'content-type', 'etag']:
                if header in response.headers:
                    check_str = ''
                    if (check_headers is not None and
                            header in check_headers):
                        if (response.headers[header] == check_headers[header]):
                            check_str = ' MATCHES EXPECTED VALUE'
                        else:
                            check_str = ' EXPECTED %s' % (
                                check_headers[header])
                    print(
                        "  %s: %s%s" %
                        (header, response.headers[header], check_str))
311050
def _connected(self, watcher, events):
        """"""
        self.connected = True
        self._finish()
        self.deferred.callback(self.sock)
247770
public void syncHeaderToMain()
    {
        // Don't call super.
        this.syncContactTypeToMain();
        ReferenceField fldMain = (ReferenceField)this.getMainRecord().getField(MessageDetail.PERSON_ID);
        this.syncRecordToMainField(fldMain, null, DBParams.HEADER_OBJECT_ID);
    }
1332290
public void head(final String aBucket, final String aKey, final Handler<HttpClientResponse> aHandler) {
        createHeadRequest(aBucket, aKey, aHandler).end();
    }
1313163
def head(path, options = {}, &block)
      ensure_method_maintained_across_redirects options
      perform_request Net::HTTP::Head, path, options, &block
    end
444667
def _get_head_id(cls, request):
        
        head_id = request.url.query.get('head', None)

        if head_id is not None:
            cls._validate_id(head_id)

        return head_id
955005
final void updateHead(Node<E> h, Node<E> p) {
        // assert h != null && p != null && (h == p || h.item == null);
        if (h != p && casHead(h, p))
            lazySetNext(h, sentinel());
    }
1122026
public function setHead($head)
    {
        if ($head < 0) {
            return false;
        }

        if ($head > (count($this->tokens) - 1)) {
            return false;
        }

        $this->head = $head;
        return true;
    }
758374
def is_connected(self):
        
        if self._client is not None:
            try:
                self._client.server_info()
            except ConnectionFailure:
                return False
            return True
        else:
            return False
288661
public void setHead(Token v) {
    if (DependencyRelation_Type.featOkTst && ((DependencyRelation_Type)jcasType).casFeat_head == null)
      jcasType.jcas.throwFeatMissing("head", "de.julielab.jules.types.DependencyRelation");
    jcasType.ll_cas.ll_setRefValue(addr, ((DependencyRelation_Type)jcasType).casFeatCode_head, jcasType.ll_cas.ll_getFSRef(v));}
434798
public function setFileHead(): void
    {
        // check local service file
        $this->fileHead = $this->prepareFilePath('head', false);
        if (!file_exists($this->fileHead)) {
            // look up for default file
            $this->fileHead = $this->prepareDefaultFilePath('head');
        }
    }
63225
def verify_ws2p_head(self, head: Any) -> bool:
        
        signature = base64.b64decode(head.signature)
        inline = head.inline()
        prepended = signature + bytes(inline, 'ascii')

        try:
            self.verify(prepended)
            return True
        except ValueError:
            return False
1002829
Node<E> first() {
        restartFromHead:
        for (;;)
            for (Node<E> h = head, p = h, q;;) {
                if ((q = p.prev) != null &&
                    (q = (p = q).prev) != null)
                    // Check for head updates every other hop.
                    // If p == q, we are sure to follow head instead.
                    p = (h != (h = head)) ? h : q;
                else if (p == h
                         // It is possible that p is PREV_TERMINATOR,
                         // but if so, the CAS is guaranteed to fail.
                         || HEAD.compareAndSet(this, h, p))
                    return p;
                else
                    continue restartFromHead;
            }
    }
212576
public function head($url, $fields = null, callable $callback = null)
    {
        $this->send($url, self::HEAD, $fields, $callback);
    }
1337448
public static function loginHead( $callback, $priority = null, $accepted_args = null ) {
		self::action( 'login_head', $callback, $priority, $accepted_args );
	}