Files
pyGoEdge-UserPanel/.venv/Lib/site-packages/django/utils/__pycache__/functional.cpython-312.pyc

163 lines
18 KiB
Plaintext
Raw Normal View History

2025-11-18 03:36:49 +08:00
<EFBFBD>
j<> i<>8<00><00><><00>ddlZddlZddlZddlmZGd<03>d<04>ZGd<05>d<06>ZGd<07>d<08>Zd <09>Zd
<EFBFBD>Z d <0B>Z
d <0C>Z d <0A>Z e <0A>Zd<0E>ZGd<0F>d<10>Zd<11>ZGd<12>de<10>Zd<14>Zy)<15>N)<01>wrapsc<00>8<00>eZdZdZdZed<03><00>Zd<04>Zd<05>Zdd<06>Z y)<08>cached_propertyz<79>
Decorator that converts a method with a single self argument into a
property cached on the instance.
A cached property can be made out of an existing method:
(e.g. ``url = cached_property(get_absolute_url)``).
Nc<00><00>td<01><00>)NzICannot use cached_property instance without calling __set_name__() on it.<2E><01> TypeError)<01>instances <20>FE:\Project\pygoedge\.venv\Lib\site-packages\django/utils/functional.py<70>funczcached_property.funcs<00><00><17> $<24>
<EFBFBD>
<EFBFBD>c<00>4<00>||_t|d<01>|_y)N<>__doc__)<03> real_func<6E>getattrr<00><02>selfr s r
<00>__init__zcached_property.__init__s<00><00><1D><04><0E><1E>t<EFBFBD>Y<EFBFBD>/<2F><04> r c<00><><00>|j<00>||_|j|_y||jk7rtd|j<00>d|<02>d<03><05><00>y)Nz?Cannot assign the same cached_property to two different names (z and z).)<04>namerr r)r<00>ownerrs r
<00> __set_name__zcached_property.__set_name__sJ<00><00> <0F>9<EFBFBD>9<EFBFBD> <1C><1C>D<EFBFBD>I<EFBFBD><1C><0E><0E>D<EFBFBD>I<EFBFBD> <11>T<EFBFBD>Y<EFBFBD>Y<EFBFBD> <1E><1B>"&<26>)<29>)<29>T<EFBFBD>3<><0E> <0E>r c<00>b<00>|<01>|S|j|<01>x}|j|j<|S)z<>
Call the function and put the return value in instance.__dict__ so that
subsequent attribute access on the instance returns the cached value
instead of calling cached_property.__get__().
)r <00>__dict__r)rr <00>cls<6C>ress r
<00>__get__zcached_property.__get__'s6<00><00> <14> <1B><17>K<EFBFBD>-1<>Y<EFBFBD>Y<EFBFBD>x<EFBFBD>-@<40>@<40><03>h<EFBFBD><1F><1F><04> <09> <09>*<2A><12>
r <00>N)
<EFBFBD>__name__<5F>
__module__<EFBFBD> __qualname__rr<00> staticmethodr rrr<00>r r
rrs/<00><00><08> <10>D<EFBFBD><11>
<EFBFBD><12>
<EFBFBD> 0<><0E> r rc<00>&<00>eZdZdZdd<03>Zdd<04>Zd<05>Zy)<07> classpropertyz<79>
Decorator that converts a method with a single cls argument into a property
that can be accessed directly from the class.
Nc<00><00>||_yr<00><01>fget<65>r<00>methods r
rzclassproperty.__init__9s <00><00><1A><04> r c<00>$<00>|j|<02>Srr&)rr rs r
rzclassproperty.__get__<s<00><00><13>y<EFBFBD>y<EFBFBD><13>~<7E>r c<00><00>||_|Srr&r(s r
<00>getterzclassproperty.getter?s<00><00><1A><04> <09><13> r r)rrr rrrr,r"r r
r$r$3s<00><00><08>
<1B><1E>r r$c<00><00>eZdZdZy)<03>Promisez<65>
Base class for the proxy class created in the closure of the lazy function.
It's used to recognize promises in code.
N)rrr rr"r r
r.r.Ds <00><00><08>
 r r.c<00><><00><00><01><06>G<00><00>fd<01>dt<00><00><06>D]J}|j<00>D]5}|jD]$}t<00>|<04>r<01>|d<03><01>fd<04>
}t <00>||<05><00>&<00>7<00>Lt <00><00><00>fd<05><08>}|S)a
Turn any callable into a lazy evaluated callable. result classes or types
is required -- at least one is needed so that the automatic forcing of
the lazy evaluation code is triggered. Results are not memoized; the
function is evaluated on every access.
c<00><><00><02>eZdZdZd<02>Z<04><00>fd<03>Zd<04>Z<06>fd<05>Zd<06>Zd<07>Z d<08>Z
d <09>Z d
<EFBFBD>Z d <0B>Z d <0C>Zd <0A>Zd<0E>Zd<0F>Zd<10>Zd<11>Zd<12>Zd<13>Zy)<15>lazy.<locals>.__proxy__z<5F>
Encapsulate a function call and act as a proxy for methods that are
called on the result of that function. The function is not evaluated
until one of the methods on the result is called.
c<00> <00>||_||_yr<00><02>_args<67>_kw)r<00>args<67>kws r
rz lazy.<locals>.__proxy__.__init__\s<00><00><1D>D<EFBFBD>J<EFBFBD><19>D<EFBFBD>Hr c<00>H<00><02>t<00>|j|jf<03>zfSr)<03>_lazy_proxy_unpickler4r5)rr <00> resultclassess <20><>r
<00>
__reduce__z"lazy.<locals>.__proxy__.__reduce__`s'<00><><00>$<24><15>t<EFBFBD>z<EFBFBD>z<EFBFBD>4<EFBFBD>8<EFBFBD>8<EFBFBD>,<2C>}<7D><<3C><0E> r c<00>"<00>||t|<00><|Sr)<01>id)r<00>memos r
<00> __deepcopy__z$lazy.<locals>.__proxy__.__deepcopy__fs<00><00>"<22>D<EFBFBD><12>D<EFBFBD><18>N<EFBFBD><17>Kr c<00><<00><01><00>|ji|j<00><01>Srr3rs <20>r
<00>__castzlazy.<locals>.__proxy__.__castms<00><><00><17><14><1A><1A>0<>t<EFBFBD>x<EFBFBD>x<EFBFBD>0<> 0r c<00>4<00>t|j<00><00>Sr)<02>repr<70>_proxy____cast<73>rs r
<00>__repr__z lazy.<locals>.__proxy__.__repr__s<00><00><00><17><04> <0B> <0B> <0A>&<26> &r c<00>4<00>t|j<00><00>Sr)<02>strrDrEs r
<00>__str__zlazy.<locals>.__proxy__.__str__vs<00><00><16>t<EFBFBD>{<7B>{<7B>}<7D>%<25> %r c<00>h<00>t|t<00>r|j<00>}|j<00>|k(Sr<00><03>
isinstancer.rD<00>r<00>others r
<00>__eq__zlazy.<locals>.__proxy__.__eq__y<00>(<00><00><19>%<25><17>)<29><1D> <0C> <0C><0E><05><17>;<3B>;<3B>=<3D>E<EFBFBD>)<29> )r c<00>h<00>t|t<00>r|j<00>}|j<00>|k7SrrLrNs r
<00>__ne__zlazy.<locals>.__proxy__.__ne__~rQr c<00>h<00>t|t<00>r|j<00>}|j<00>|kSrrLrNs r
<00>__lt__zlazy.<locals>.__proxy__.__lt__<5F><00>(<00><00><19>%<25><17>)<29><1D> <0C> <0C><0E><05><17>;<3B>;<3B>=<3D>5<EFBFBD>(<28> (r c<00>h<00>t|t<00>r|j<00>}|j<00>|kSrrLrNs r
<00>__le__zlazy.<locals>.__proxy__.__le__<5F>rQr c<00>h<00>t|t<00>r|j<00>}|j<00>|kDSrrLrNs r
<00>__gt__zlazy.<locals>.__proxy__.__gt__<5F>rVr c<00>h<00>t|t<00>r|j<00>}|j<00>|k\SrrLrNs r
<00>__ge__zlazy.<locals>.__proxy__.__ge__<5F>rQr c<00>4<00>t|j<00><00>Sr)<02>hashrDrEs r
<00>__hash__z lazy.<locals>.__proxy__.__hash__<5F>rGr c<00>6<00>t|j<00>|<01>Sr)<02>formatrD)r<00> format_specs r
<00>
__format__z"lazy.<locals>.__proxy__.__format__<5F>s<00><00><19>$<24>+<2B>+<2B>-<2D><1B>5<> 5r c<00>(<00>|j<00>|zSr<00>rDrNs r
<00>__add__zlazy.<locals>.__proxy__.__add__<5F><00><00><00><17>;<3B>;<3B>=<3D>5<EFBFBD>(<28> (r c<00>(<00>||j<00>zSrrerNs r
<00>__radd__z lazy.<locals>.__proxy__.__radd__<5F>s<00><00><18>4<EFBFBD>;<3B>;<3B>=<3D>(<28> (r c<00>(<00>|j<00>|zSrrerNs r
<00>__mod__zlazy.<locals>.__proxy__.__mod__<5F>rgr c<00>(<00>|j<00>|zSrrerNs r
<00>__mul__zlazy.<locals>.__proxy__.__mul__<5F>rgr N)rrr rrr;r?rDrFrJrPrSrUrXrZr\r_rcrfrirkrm)r r:s<00><>r
<00> __proxy__r1Usb<00><><00> <0C>  <1A> <0E>  <18> 1<>  '<27> &<26> *<2A>
 *<2A>
 )<29>
 *<2A>
 )<29>
 *<2A>
 '<27> 6<>  )<29> )<29> )<29> )r rn)<01> __method_namec<00>`<00><01><00>|ji|j<00><01>}t||<01>|i|<03><01>Sr)r4r5r)rror6r7<00>resultr s <20>r
<00> __wrapper__zlazy.<locals>.__wrapper__<5F>s5<00><><00>"<22>4<EFBFBD>:<3A>:<3A>:<3A><14><18><18>:<3A>F<EFBFBD>9<>7<EFBFBD>6<EFBFBD>=<3D>9<>4<EFBFBD>F<>2<EFBFBD>F<>Fr c<00><00><01><00>||<01>Srr")r6r7rns <20>r
rrzlazy.<locals>.__wrapper__<5F>s<00><><00><19><14>r<EFBFBD>"<22>"r )r.<00>mror<00>hasattr<74>setattrr)r r:<00> resultclass<73>type_<65> method_namerrrns`` @r
<00>lazyrzMs<><00><><00>U)<29>G<EFBFBD>U)<29>r%<25> <0B> <20>_<EFBFBD>_<EFBFBD>&<26>E<EFBFBD>$<24>~<7E>~<7E> <0B><1B>9<EFBFBD>k<EFBFBD>2<><1C><G<01>G<01> <18> <09>;<3B> <0B><<3C> .<2E>'<27>%<25>$ <0B>4<EFBFBD>[<5B>#<23><11>#<23> <17>r c<00>&<00>t|g|<03><01><06>|i|<02><01>Sr)rz)r r6<00>kwargsr:s r
r9r9<00>s<00><00> %<25>4<EFBFBD><04> %<25>}<7D> %<25>t<EFBFBD> 6<>v<EFBFBD> 6<>6r c<00>6<00>ttt<00>|<00>S)zK
Shortcut for the common case of a lazy callable that returns str.
)rzrI)<01>texts r
<00>lazystrr<00>s<00><00> <1A>4<EFBFBD><03>S<EFBFBD>><3E>$<24> <1F>r c<00>,<00><00><00>s td<01><00><01>fd<02>}|S)z<>
A decorator that allows a function to be called with one or more lazy
arguments. If none of the args are lazy, the function is evaluated
immediately, otherwise a __proxy__ is returned that will evaluate the
function when needed.
z3You must pass at least one argument to keep_lazy().c<00>L<00><01><00><02>t<00>g<01><03><01><06><00>t<00><00><00><00>fd<01><08>}|S)Nc<00><><00><02>td<01>tj||j<00><00>D<00><00>r<00>|i|<01><01>S<00>|i|<01><01>S)Nc3<00><K<00>|]}t|t<00><00><01><00>y<00>wr)rMr.)<02>.0<EFBFBD>args r
<00> <genexpr>z@keep_lazy.<locals>.decorator.<locals>.wrapper.<locals>.<genexpr><3E>s<00><00><><00><0E>A<>C<EFBFBD><1B>3<EFBFBD><07>(<28>A<>s<00>)<04>any<6E> itertools<6C>chain<69>values)r6r|r <00> lazy_funcs <20><>r
<00>wrapperz-keep_lazy.<locals>.decorator.<locals>.wrapper<65>sK<00><><00><12><0E>$<24>?<3F>?<3F>4<EFBFBD><16><1D><1D><1F>A<><0E><0E>!<21>$<24>1<>&<26>1<>1<><17><14>(<28><16>(<28> (r )rzr)r r<>r<>r:s` @<40>r
<00> decoratorzkeep_lazy.<locals>.decorator<6F>s/<00><><00><18><14>.<2E> <0A>.<2E> <09> <0E>t<EFBFBD><1B> )<29>
<15> )<29><17>r r)r:r<>s` r
<00> keep_lazyr<79><00>s!<00><><00> <19><17>M<>N<>N<> <17> <15>r c<00>,<00>tt<00>|<00>S)zO
A decorator for functions that accept lazy arguments and return text.
)r<>rI)r s r
<00>keep_lazy_textr<74><00>s<00><00> <1A>9<EFBFBD>S<EFBFBD>><3E>$<24> <1F>r c<00> <00><00><00>fd<01>}d|_|S)Nc<00>v<00><01>|jx}tur|j<00>|j}<00>|g|<01><01><06>Sr)<03>_wrapped<65>empty<74>_setup)rr6r<>r s <20>r
<00>innerznew_method_proxy.<locals>.inner<65>s6<00><><00><1C> <0A> <0A> %<25>H<EFBFBD>%<25> /<2F> <10>K<EFBFBD>K<EFBFBD>M<EFBFBD><1B>}<7D>}<7D>H<EFBFBD><13>H<EFBFBD>$<24>t<EFBFBD>$<24>$r F)<01> _mask_wrapped)r r<>s` r
<00>new_method_proxyr<79><00>s<00><><00>%<25>  <20>E<EFBFBD><17> <10>Lr c<00>,<00><00>eZdZdZdZd<03>Z<05>fd<04>Zee<08>Z d<05>Z
d<06>Z d<07>Z d<08>Z d <09>Zd
<EFBFBD>Zee<10>Zee<12>Zee<14>Zee<16>Zeeej4d <0B><00><00>Zeej8<00>Zeej<<00>Zeej@<00>Z!eejD<00>Z#ee$<24>Z%eejL<00>Z'eejP<00>Z)eejT<00>Z+ee,<2C>Z-ee.<2E>Z/eej`<00>Z1<5A>xZ2S) <0C>
LazyObjectz<EFBFBD>
A wrapper for another class that can be used to delay instantiation of the
wrapped class.
By subclassing, you have the opportunity to intercept and alter the
instantiation. If you don't need to do that, use SimpleLazyObject.
Nc<00><00>t|_yr)r<>r<>rEs r
rzLazyObject.__init__s <00><00><1E><04> r c<00>t<00><01>|dk(rt<00>|<00>|<01>St<00>|<00>|<01>}t|dd<03>st<00>|S)Nr<4E>r<>T)<04>super<65>__getattribute__r<00>AttributeError)rr<00>value<75> __class__s <20>r
r<>zLazyObject.__getattribute__sC<00><><00> <0F>:<3A> <1D><18>7<EFBFBD>+<2B>D<EFBFBD>1<> 1<><15><07>(<28><14>.<2E><05><17>u<EFBFBD>o<EFBFBD>t<EFBFBD>4<> <20> <20><14> r c<00><><00>|dk(r||jd<y|jtur|j<00>t |j||<02>y)Nr<4E>)rr<>r<>r<>rv)rrr<>s r
<00> __setattr__zLazyObject.__setattr__!s=<00><00> <0F>:<3A> <1D>(-<2D>D<EFBFBD>M<EFBFBD>M<EFBFBD>*<2A> %<25><13>}<7D>}<7D><05>%<25><14> <0B> <0B> <0A> <13>D<EFBFBD>M<EFBFBD>M<EFBFBD>4<EFBFBD><15> /r c<00><><00>|dk(r td<02><00>|jtur|j<00>t |j|<01>y)Nr<4E>zcan't delete _wrapped.)rr<>r<>r<><00>delattr)rrs r
<00> __delattr__zLazyObject.__delattr__*s9<00><00> <0F>:<3A> <1D><1B>4<>5<> 5<> <0F>=<3D>=<3D>E<EFBFBD> !<21> <10>K<EFBFBD>K<EFBFBD>M<EFBFBD><0F><04> <0A> <0A>t<EFBFBD>$r c<00><00>td<01><00>)zU
Must be implemented by subclasses to initialize the wrapped object.
z7subclasses of LazyObject must provide a _setup() method)<01>NotImplementedErrorrEs r
r<>zLazyObject._setup1s<00><00>"<22> E<>
<EFBFBD>
r c<00>l<00>|jtur|j<00>t|jffSr)r<>r<>r<><00>unpickle_lazyobjectrEs r
r;zLazyObject.__reduce__Gs)<00><00> <0F>=<3D>=<3D>E<EFBFBD> !<21> <10>K<EFBFBD>K<EFBFBD>M<EFBFBD>#<23>d<EFBFBD>m<EFBFBD>m<EFBFBD>%5<>6<>6r c<00><><00>|jturt|<00><00>Stj|j<00>Sr)r<>r<><00>type<70>copyrEs r
<00>__copy__zLazyObject.__copy__Ls3<00><00> <0F>=<3D>=<3D>E<EFBFBD> !<21><1E>4<EFBFBD><04>:<3A><<3C> <1F><18>9<EFBFBD>9<EFBFBD>T<EFBFBD>]<5D>]<5D>+<2B> +r c<00><><00>|jtur t|<00><00>}||t|<00><|St j
|j|<01>Sr)r<>r<>r<>r=r<><00>deepcopy<70>rr>rqs r
r?zLazyObject.__deepcopy__UsD<00><00> <0F>=<3D>=<3D>E<EFBFBD> !<21> <20>T<EFBFBD>$<24>Z<EFBFBD>\<5C>F<EFBFBD>#<23>D<EFBFBD><12>D<EFBFBD><18>N<EFBFBD><19>M<EFBFBD><13>}<7D>}<7D>T<EFBFBD>]<5D>]<5D>D<EFBFBD>1<>1r r<>)3rrr rr<>rr<>r<>r<00> __getattr__r<5F>r<>r<>r;r<>r?<00>bytes<65> __bytes__rIrJ<00>bool<6F>__bool__<5F>dir<69>__dir__<5F>property<74>operator<6F>
attrgetterr<EFBFBD><00>eqrP<00>ltrU<00>gtrZ<00>nerSr^r_<00>getitem<65> __getitem__<5F>setitem<65> __setitem__<5F>delitem<65> __delitem__<5F>iter<65>__iter__<5F>len<65>__len__<5F>contains<6E> __contains__<5F> __classcell__<5F>r<>s@r
r<>r<>s'<00><><00><08><14>H<EFBFBD><1E>
<15>#<23>7<EFBFBD>+<2B>K<EFBFBD>0<>%<25>
<EFBFBD>,7<>
,<2C>2<>!<21><15>'<27>I<EFBFBD><1E>s<EFBFBD>#<23>G<EFBFBD><1F><04>%<25>H<EFBFBD><1F>s<EFBFBD>#<23>G<EFBFBD><19>)<29>*=<3D>(<28>*=<3D>*=<3D>k<EFBFBD>*J<>K<>L<>I<EFBFBD> <1D>h<EFBFBD>k<EFBFBD>k<EFBFBD> *<2A>F<EFBFBD> <1D>h<EFBFBD>k<EFBFBD>k<EFBFBD> *<2A>F<EFBFBD> <1D>h<EFBFBD>k<EFBFBD>k<EFBFBD> *<2A>F<EFBFBD> <1D>h<EFBFBD>k<EFBFBD>k<EFBFBD> *<2A>F<EFBFBD><1F><04>%<25>H<EFBFBD>#<23>8<EFBFBD>#3<>#3<>4<>K<EFBFBD>"<22>8<EFBFBD>#3<>#3<>4<>K<EFBFBD>"<22>8<EFBFBD>#3<>#3<>4<>K<EFBFBD><1F><04>%<25>H<EFBFBD><1E>s<EFBFBD>#<23>G<EFBFBD>#<23>H<EFBFBD>$5<>$5<>6<>Lr r<>c<00><00>|S)zh
Used to unpickle lazy objects. Just return its argument, which will be the
wrapped object.
r")<01>wrappeds r
r<>r<>ws <00><00>
<13>Nr c<00>n<00><00>eZdZdZ<03>fd<02>Zd<03>Zd<04>Zd<05>Zd<06>Ze e
j<00>Z e d<07><00>Z <0A>xZS)<08>SimpleLazyObjectz<74>
A lazy object initialized from any function.
Designed for compound objects of unknown type. For builtins or objects of
known type, use django.utils.functional.lazy.
c<00>@<00><01>||jd<t<00>|<00> <00>y)aC
Pass in a callable that returns the object to be wrapped.
If copies are made of the resulting SimpleLazyObject, which can happen
in various circumstances within Django, then you must ensure that the
callable can be safely run more than once and will return the same
value.
<20>
_setupfuncN)rr<>r)rr r<>s <20>r
rzSimpleLazyObject.__init__<5F>s<00><><00>'+<2B><04> <0A> <0A>l<EFBFBD>#<23> <0A><07><18>r c<00>.<00>|j<00>|_yr)r<>r<>rEs r
r<>zSimpleLazyObject._setup<75>s<00><00><1C><0F><0F>)<29><04> r c<00><><00>|jtur |j}n |j}dt|<00>j<00>d|<01>d<03>S)N<><z: <20>>)r<>r<>r<>r<>r)r<00> repr_attrs r
rFzSimpleLazyObject.__repr__<5F>s6<00><00> <0F>=<3D>=<3D>E<EFBFBD> !<21><1C><0F><0F>I<EFBFBD><1C> <0A> <0A>I<EFBFBD><49>!<21>$<24>Z<EFBFBD>0<>0<>)<29><<3C><r c<00><><00>|jturt|j<00>St j|j<00>Sr)r<>r<>r<>r<>r<>rEs r
r<>zSimpleLazyObject.__copy__<5F>s4<00><00> <0F>=<3D>=<3D>E<EFBFBD> !<21>$<24>D<EFBFBD>O<EFBFBD>O<EFBFBD>4<> 4<><18>9<EFBFBD>9<EFBFBD>T<EFBFBD>]<5D>]<5D>+<2B> +r c<00><><00>|jtur%t|j<00>}||t |<00><|St j |j|<01>Sr)r<>r<>r<>r<>r=r<>r<>r<>s r
r?zSimpleLazyObject.__deepcopy__<5F>sE<00><00> <0F>=<3D>=<3D>E<EFBFBD> !<21>&<26>d<EFBFBD>o<EFBFBD>o<EFBFBD>6<>F<EFBFBD>#<23>D<EFBFBD><12>D<EFBFBD><18>N<EFBFBD><19>M<EFBFBD><13>}<7D>}<7D>T<EFBFBD>]<5D>]<5D>D<EFBFBD>1<>1r c<00> <00>||zSrr"rNs r
rizSimpleLazyObject.__radd__<5F>s <00><00><14>t<EFBFBD>|<7C>r )rrr rrr<>rFr<>r?r<>r<><00>addrfrir<>r<>s@r
r<>r<>sC<00><><00><08>
<1B>*<2A>
=<3D>,<2C>2<><1F>x<EFBFBD>|<7C>|<7C>,<2C>G<EFBFBD><15><1C><16>r r<>c<00>P<00>ggf}|D]}|||<03>j|<03><00>|S)z<>
Split the values into two sets, based on the return value of the function
(True/False). e.g.:
>>> partition(lambda x: x > 3, range(5))
[0, 1, 2, 3], [4]
)<01>append)<04> predicater<65><00>results<74>items r
<00> partitionr<6E><00>s3<00><00><12>2<EFBFBD>h<EFBFBD>G<EFBFBD><16><04><0F> <09>$<24><0F> <20>'<27>'<27><04>-<2D><17> <12>Nr )r<>r<>r<><00> functoolsrrr$r.rzr9rr<>r<><00>objectr<74>r<>r<>r<>r<>r<>r"r r
<00><module>r<>s}<00><01> <0B><10><0F><1B>)<13>)<13>X<14><14>" <09> <09>x<17>v7<> <20><15>6 <20> <0F><08><05><11>q7<>q7<>h<13>6<1C>z<EFBFBD>6<1C>r r