a c@sddlZddlmZejr.ddlZddlmZeZ ej ddddd d Z ej de ej ddd d Z de ej ddd d Z dddddZddddZdej e ej e dddZdS)N)local)ContextFzte.Literal[False]r)silentreturncCsdSNrrrZ/workspaces/shunt/resources/test-fastapi/venv/lib/python3.9/site-packages/click/globals.pyget_current_context sr .cCsdSrrr rrr r sc CsPztdtjdWSttfyJ}z|s6td|WYd}~n d}~00dS)aReturns 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`. rz!There is no active click context.N)tcast_localstackAttributeError IndexError RuntimeError)rerrr r s  )ctxrcCstjdg|dS)z*Pushes a new context to the current stack.rN)r__dict__ setdefaultappend)rrrr push_context-sr)rcCstjdS)z%Removes the top level from the stack.N)rrpoprrrr pop_context2sr)colorrcCs(|dur |Stdd}|dur$|jSdS)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)rrrrr resolve_color_default7s  r)F).)F)N)typingr threadingr TYPE_CHECKINGZtyping_extensionstecorerroverloadr boolOptionalrrrrrrr s