code: def test_explicit_head(app, client):
      class Index(flask.views.MethodView):
          def get(self):
              return "GET"
  
          def head(self):
              return flask.Response("", headers={"X-Method": "HEAD"})
  
      app.add_url_rule("/", view_func=Index.as_view("index"))
      rv = client.get("/")
      assert rv.data == b"GET"
      rv = client.head("/")
      assert rv.data == b""
      assert rv.headers["X-Method"] == "HEAD"
  
file_path: flask/tests/test_views.py
imports: import pytest
  from werkzeug.http import parse_set_header
  import flask.views
label_desc: Use image node_id 9 for calling a global function with example usage: test_explicit_head(app, client) and returns: str, flask