code: def has_request_context() -> bool:
      """If you have code that wants to test if a request context is there or
      not this function can be used.  For instance, you may want to take advantage
      of request information if the request object is available, but fail
      silently if it is unavailable.
  
      ::
  
          class User(db.Model):
  
              def __init__(self, username, remote_addr=None):
                  self.username = username
                  if remote_addr is None and has_request_context():
                      remote_addr = request.remote_addr
                  self.remote_addr = remote_addr
  
      Alternatively you can also just test any of the context bound objects
      (such as :class:`request` or :class:`g`) for truthness::
  
          class User(db.Model):
  
              def __init__(self, username, remote_addr=None):
                  self.username = username
                  if remote_addr is None and request:
                      remote_addr = request.remote_addr
                  self.remote_addr = remote_addr
  
      .. versionadded:: 0.7
      """
      return _cv_request.get(None) is not None
  
imports: from __future__ import annotations
  import contextvars
  import sys
  import typing
  from functools import update_wrapper
  from types import TracebackType
  from werkzeug.exceptions import HTTPException
  from .None import typing
  from .globals import _cv_app
  from .globals import _cv_request
  from .signals import appcontext_popped
  from .signals import appcontext_pushed
label_desc: Use image node_id 3 for calling a global function with example usage: has_request_context() and returns: unknown