
    2Bf                     N   d dl Z d dl Zd dlmZ ej                  r
d dlZddlmZ  e       Z	e j                  ddd       Ze j                  ddedej                  d   fd	       Zddedej                  d   fd
ZddZddZddej                  e   dej                  e   fdZy)    N)local   )Contextsilentreturnr   c                      y N r   s    M/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/click/globals.pyget_current_contextr              c                      y r	   r
   r   s    r   r   r      r   r   c                     	 t        j                  dt        j                  d         S # t        t
        f$ r | st        d      Y yw xY w)a  Returns the current click context.  This can be used as a way to
    access the current context object from anywhere.  This is a more implicit
    alternative to the :func:`pass_context` decorator.  This function is
    primarily useful for helpers such as :func:`echo` which might be
    interested in changing its behavior based on the current context.

    To push the current context, :meth:`Context.scope` can be used.

    .. versionadded:: 5.0

    :param silent: if set to `True` the return value is `None` if no context
                   is available.  The default behavior is to raise a
                   :exc:`RuntimeError`.
    r   z!There is no active click context.N)tcast_localstackAttributeError
IndexErrorRuntimeErrorr   s    r   r   r      sQ    Dvvib!122J' DBCC  	Ds   &) AAc                 b    t         j                  j                  dg       j                  |        y)z*Pushes a new context to the current stack.r   N)r   __dict__
setdefaultappend)ctxs    r   push_contextr   .   s!    
OOw+2237r   c                  @    t         j                  j                          y)z%Removes the top level from the stack.N)r   r   popr
   r   r   pop_contextr"   3   s    
LLr   colorc                 @    | | S t        d      }||j                  S y)zInternal helper to get the default value of the color flag.  If a
    value is passed it's returned unchanged, otherwise it's looked up from
    the current context.
    NTr   )r   r#   )r#   r   s     r   resolve_color_defaultr%   8   s+    
 
T
*C
yyr   )F)r   zte.Literal[False]r   r   ).)r   r   r   N)r   Nr	   )typingr   	threadingr   TYPE_CHECKINGtyping_extensionstecorer   r   overloadr   boolOptionalr   r"   r%   r
   r   r   <module>r/      s      ??"	    qzz)/D   I1F 08

D!1 QZZ=M r   