L iddlmZddlZddlmZej rddlmZeZ ejd d dZ ejdddZ d ddZ dd Z dd Z ddd Zy)) annotationsN)local)ContextcyNsilents S/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/click/globals.pyget_current_contextr sFIcyrr r s r r r s?Brc tjdtjdS#tt f$r}|s t d|Yd}~yd}~wwxYw)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)r es r r r sTKvvib!122 J 'KBC J  Ks&)AA  Acbtjjdgj|y)z*Pushes a new context to the current stack.rN)r__dict__ setdefaultappend)ctxs r push_contextr,s! OOw+2237rc@tjjy)z%Removes the top level from the stack.N)rrpopr rr pop_contextr"1s LLrc@||Std}| |jSy)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 color)r$rs r resolve_color_defaultr%6s+   T *C yy r)F)r zt.Literal[False]returnr).)r boolr&zContext | None)rrr&None)r&r(r)r$ bool | Noner&r)) __future__rtypingr threadingr TYPE_CHECKINGcorerroverloadr rr"r%r rr r0s["?? I IB B08  r