ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ 4]c@s dZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z ddl mZddl mZd Zd efd YZd Zd ZdZdZdZdZdZdefdYZdZddZdZeedZ e!dZ"e!dZ#dZ$dZ%dXddYdZ&defdYZ'd Z(d!Z)ddd"dd#Z*d$Z+dddd%Z,d&efd'YZ-d(Z.d)efd*YZ/d+efd,YZ0ed-Z1d.efd/YZ2d0Z3d1Z4d2Z5e!d3Z6d4Z7d5Z8dd6Z9d7Z:d8Z;d9e<fd:YZ=d;efd<YZ>d=efd>YZ?d?e@fd@YZAdAeA_BdAefdBYZCdaDdCZEdDZFdEdFZGdGejHfdHYZIdIZJdJZKdKZLejMdLZNejMdMZOeOeNdNZPeQdZRdOZSdPeQfdQYZTdRZUdSZVdTZWdUZXdVZYdWZZdS(ZsRoutines to help with the creation, loading and introspection of modules, classes, hierarchies, attributes, functions, and methods. i(tupdate_wrapperNi(t _collections(tcompati(texccCs>tjr|jd}ntj}|j||jS(Nsutf-8(Rtpy3ktencodethashlibtmd5tupdatet hexdigest(txtm((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytmd5_hexs    t safe_reraisecBs2eZdZdZedZdZdZRS(sKReraise an exception after invoking some handler code. Stores the existing exception info before invoking so that it is maintained across a potential coroutine context switch. e.g.:: try: sess.commit() except: with safe_reraise(): sess.rollback() t warn_onlyt _exc_infocCs ||_dS(N(R(tselfR((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt__init__8scCstj|_dS(N(tsystexc_infoR(R((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt __enter__;scCs|dkrI|j\}}}d|_|jstj|||qnatj r|jr|jdrtd|jd|jdfnd|_tj|||dS(NisfAn exception has occurred during handling of a previous exception. The previous exception is: %s %s i(tNoneRRRtreraiseRtwarn(Rttype_tvaluet tracebacktexc_typet exc_valuetexc_tb((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt__exit__>s     (RR(t__name__t __module__t__doc__t __slots__tFalseRRR(((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyR $s   cCs&djdtjd|jDS(Nt css|]}|jVqdS(N(tlower(t.0tn((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pys Tss ([A-Z][a-z]+)(tjointretfindallR(tcls((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytclsname_as_plain_nameRscCs^g}xK|j|j|jfD]1}t|drC|j}n|j|qWt|S(srdecode a slice object as sent to __getitem__. takes into account the 2.5 __index__() method, basically. t __index__(tstarttstoptstepthasattrR-tappendttuple(tslctretR ((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt decode_sliceXs c'st|}x|D]ytjftjfdtd}x@|D](}||krP|j||VPqPqPWtdqWdS(Ncst|S(N(tstr(ti(tbase(sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytktis&exhausted namespace for symbol base %s(tsett itertoolstchainRtitertools_imaptrangetaddt NameError(tusedtbasestpooltsym((R9sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt_unique_symbolsfs  $   ccs5x.|r0||d@}||V||N}qWdS(s6Call the given function given each nonzero bit from n.iN((tfnR'tb((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytmap_bitsvs  csfd}t|S(s'A signature-matching decorator factory.cstj| r/tj| r/tdntj|}t|d|dd!|jf}t|dd\}}t d|d|}|j t |dt |j|d>> format_argspec_plus(lambda self, a, b, c=3, **d: 123) {'args': '(self, a, b, c=3, **d)', 'self_arg': 'self', 'apply_kw': '(self, a, b, c=c, **d)', 'apply_pos': '(self, a, b, c, **d)'} iis%s[0]iiit formatvaluecSsd|S(Nt=((R ((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyR:R;Rtself_argt apply_postapply_kwiN((RtcallableRStinspect_formatargspecRtlenRT( RHRLRZRRRt num_defaultst name_argstdefaulted_valsR((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRU}sJ   %     c Cs}|tjkr$|rdpd}n:yt|d|SWn#tk r]|rTdpWd}nXtddd|d|d |S( s format_argspec_plus with considerations for typical __init__ methods Wraps format_argspec_plus with error handling strategies for typical __init__ cases:: object.__init__ -> (self) other unreflectable (usually C) -> (self, *args, **kwargs) s(self)RRLs(self, *args, **kwargs)sself, *args, **kwargsRRRR(tobjectRRURRT(tmethodRLR((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytformat_argspec_inits   cCs^ytj|SWnFtk rY|tjkrCdgdddfSdgdddfSnXdS(sinspect.getargspec with considerations for typical __init__ methods Wraps inspect.getargspec with error handling for typical __init__ cases:: object.__init__ -> (self) other unreflectable (usually C) -> (self, *args, **kwargs) RRtkwargsN(RRSRRRR(R((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytgetargspec_inits  cCs+t|tjr#|j r#|jS|SdS(sSAdjust the incoming callable such that a 'self' argument is not required. N(RhRt MethodTypeRRg(t func_or_cls((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytunbound_method_to_callablescs|dkrg}ntj|}t}g}tj}d}x8t|D]*\}} ytj| j} Wnt k rqUqUX| j rt | j pd} |dkr| j r| j }n| r|j | jd| !q6|j | jdn1|jg| jd| !D]} | |f^q| rU|jgt| j| | j D]\} } | | f^q]qUqUWg}|j fd|D|dk rt|r|j gt|D]}t|^qnx|jD]z\} }| |krqnyHt| |}||k re||kre|jd| |fnWqtk ryqXqW|rxs|D]h\} }yHt| |}||k r||kr|jd| |fnWqtk rqXqWndjjdj|fS(s}Produce a __repr__() based on direct association of the __init__() specification vs. same-named attributes present. iic3s'|]}tt|dVqdS(N(treprRWR(R&targ(tobj(sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pys 3ss%s=%rs%s(%s)s, N(RRtto_listRt OrderedDictt enumerateRRSRRRRRtextendRRtzipR1RWRtitemsR2RRt __class__RR((Rt additional_kwt to_inspectt omit_kwargtmissingtpos_argstkw_argstvargsR8tinspRZt default_lenRtdefaulttoutputtvaltdefval((RsN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt generic_reprs`        +;2    tportable_instancemethodcBs;eZdZd ZdZdZd dZdZRS( s_Turn an instancemethod into a (parent, name) pair to produce a serializable callable. RKRMRt __weakref__cCs"i|jd6|jd6|jd6S(NRKRMR(RKRMR(R((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt __getstate__Vs  cCs3|d|_|d|_|jdd|_dS(NRKRMR((RKRMRR(Rtstate((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt __setstate__]s  cCs%|j|_|j|_||_dS(N(RRKRRMR(RtmethR((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRbs  cOs,|j|jt|j|j||S(N(RRRWRKRM(RRtkw((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRgs(RKRMRR((RR R!R"RRRR(((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRNs    cstjr%t|tjr%tSn|ht|j}x=|r||j}tjrt|tjrsq@nfd|jD}nfd|jD}x(|D] }|j |j |qWtj r|j dks@t |d r)q@q)n%|j dks@t |d r)q@nxMg|jD]}|kr9|^q9D] }|j |j |qUWq@WtS(sReturn an unordered sequence of all classes related to cls. Traverses diamond hierarchies. Fibs slightly: subclasses of builtin types are not returned. Thus class_hierarchy(class A(object)) returns (A, object), not A plus every class systemwide that derives from object. Old-style classes are discarded and hierarchies rooted on them will not be descended. c3s4|]*}|krt|tj r|VqdS(N(RhRt ClassType(R&t_(thier(sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pys sc3s!|]}|kr|VqdS(N((R&R(R(sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pys stbuiltinst__subclasses__t __builtin__(RRlRhRRRt__mro__tpopRR2RARR R1R(R+tprocessRRDRIRts((RsN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytclass_hierarchyls4            2 ccsZt|}xG|D]?}x6|jD]+}||jkr#||j|fVPq#q#WqWdS(siterate all the keys and attributes associated with a class, without using getattr(). Does not use getattr() so that class-sensitive descriptors (i.e. property.__get__()) are not called. N(tdirRR(R+tkeystkeyR((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytiterate_attributess   s self.proxycCs|r|}nn|dkr$d}ngt|D]F}|jdr1|jdr1t|| r1||kr1|^q1}x4|D],}y:t||} t| dswnt| d | } Wntk rqnXy=tj| } tj | d } tj | d d } Wnt k r7d } d } nXdt } |dk r^i||6pai}tj | |y| j ||_ Wntk rnXt||||qWdS(s9Automates delegation of __specials__ for a proxying type.R"t__del__t__getattribute__t __metaclass__RRt__RRNiis(self, *args, **kw)s (*args, **kw)s?def %(method)s%(fn_args)s: return %(name)s.%(method)s%(d_args)sN(R"RRRRR(RRt startswithtendswithR1RWRRRSRRtlocalstexec_RXtsetattr(tinto_clstfrom_clstskiptonlyRMt from_instancetdundersR RRHRZtfn_argstd_argstpyRc((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytmonkeypatch_proxied_specialssN          cCs"t|d|t|d|kS(s;Return True if the two methods are the same implementation.Rg(RW(tmeth1tmeth2((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytmethods_equivalentsc Cs1| r| rtdnt|tr?t||r?|St|psgt|D]}|jdsU|^qU}tt|}tj}t|tr|}n'|st}tj}n t|}||j ||r|St|t s>|tjkrdpd}td||dj |fndt fdY} |rmd |j | _ nt} xt|D]v\} } | |krtd | ntj| std | | fnt| | t| | j| qW|| |r| Std dj || d S(sEnsure basic interface compliance for an instance or dict of callables. Checks that ``obj`` implements public methods of ``cls`` or has members listed in ``methods``. If ``required`` is not supplied, implementing at least one interface method is sufficient. Methods present on ``obj`` that are not in the interface are ignored. If ``obj`` is a dict and ``dict`` does not meet the interface requirements, the keys of the dictionary are inspected. Keys present in ``obj`` that are not in the interface will raise TypeErrors. Raises TypeError if ``obj`` does not meet the interface criteria. In all passing cases, an object with callable members is returned. In the simple case, ``obj`` is returned as-is; if dict processing kicks in then an anonymous class is returned. obj A type, instance, or dictionary of callables. cls Optional, a type. All public methods of cls are considered the interface. An ``obj`` instance of cls will always pass, ignoring ``required``.. methods Optional, a sequence of method names to consider as the interface. required Optional, a sequence of mandatory implementations. If omitted, an ``obj`` that provides at least one interface method is considered sufficient. As a convenience, required may be a type, in which case all public methods of the type are required. s2a class or collection of method names are requiredRsany ofsall ofs%r does not implement %s: %ss, tAnonymousInterfacecBseZdZRS(sA callable-holding shell.(RR R!(((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyR4st Anonymouss%r: unknown in this interfaces%r=%r is not callables,dictionary does not contain required keys %sN(RRhRiR<RRtoperatortgetgtt intersectionRTR(RRtdictlike_iteritemsRRRt staticmethodRA( RR+tmethodstrequiredR t interfacet implementedtcompliest qualifierRtfoundRR}((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt as_interfacesH!:       tmemoized_propertycBs;eZdZddZdZdZedZRS(s2A read-only @property that is only evaluated once.cCs+||_|p|j|_|j|_dS(N(tfgetR!R(RRRo((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyROs cCs1|dkr|S|j||j|j<}|S(N(RRRR(RRR+tresult((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt__get__Ts cCstj||jdS(N(RtresetR(RR((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt_resetZscCs|jj|ddS(N(RRR(R+RRM((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyR]sN( RR R!RRRRt classmethodR(((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRLs    csfd}t|S(sDecorate a method memoize its return value. Best applied to no-arg methods: memoization is not sensitive to argument values, and will always return the same value even when called with different arguments. csM|||fd}j|_j|_||jj<S(NcsS(N((taR(R(sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytmemons(RR!R(RRRR (RH(RsN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytoneshotks   (R(RHR!((RHsN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytmemoized_instancemethodbs  t!group_expirable_memoized_propertycBs5eZdZddZdZdZdZRS(s?A family of @memoized_properties that can be expired in tandem.cCs&g|_|r"|jj|ndS(N(t attributesR(RR$((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyR|s cCs1|j}x!|jD]}|j|dqWdS(s.Expire all memoized properties for *instance*.N(RR$RR(Rtinstancetstasht attribute((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytexpire_instances cCs|jj|jt|S(N(R$R2RR(RRH((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRscCs|jj|jt|S(N(R$R2RR"(RRH((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRs((RR R!RR(RR(((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyR#ys    t MemoizedSlotscBs&eZdZdZdZdZRS(sApply memoized items to an object using a __getattr__ scheme. This allows the functionality of memoized_property and memoized_instancemethod to be available to a class using __slots__. cCst|dS(N(R(RR((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt_fallback_getattrscsjdrtntdr[td}t||Stdrtdfd}j|_|SjSdS(Nt _memoizeds_memoized_attr_%ss_memoized_method_%scsJ||fd}j|_j|_t|S(NcsS(N((RR(R(sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyR s(RR!R(RRR (RHRR(RsN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyR!s   (RRR1RWRR!R*(RRRR!((RHRRsN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt __getattr__s ((RR R!R"R*R,(((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyR)s csfd}|S(Ncsjd}tjdj|dd!tt|dg}t||d}t||j|rt |dr|j j |jn|S(NRdiit__all__( RjRR~R(tglobalsRRWRRR1R-R2(RttokensR(t add_to_allt modulename(sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRas/((R1R0Ra((R0R1sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytdependency_fors t dependenciescBsTeZdZdZdZedZeZiZ de fdYZ RS(sApply imported dependencies as arguments to a function. E.g.:: @util.dependencies( "sqlalchemy.sql.widget", "sqlalchemy.engine.default" ); def some_func(self, widget, default, arg1, arg2, **kw): # ... Rationale is so that the impact of a dependency cycle can be associated directly with the few functions that cause the cycle, and not pollute the module-level namespace. cGs]g|_xM|D]E}|jd}|jjtjdj|dd!|dqWdS(NRdii(t import_depsRjR2R3t _importlaterR((RtdepstdepR/((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRs    c Cs!|j}tj|}t|d}|dd k}x<tt|D](}d||d||rndndRA(RRARE((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRs  cCs|jd|jS(NRd(RGRH(R((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyR?scCsA|tjkr.td|j|jfnt|j|jS(Ns<importlater.resolve_all() hasn't been called (this is %s %s)(R3R>RxRGRHRWt_initial_import(R((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytmodules cCs>tjj|tj|jtt|jg|_ dS(N( R3R>RRR~RGR.RRHRI(R((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyR@&scCsv|dkr"td|jnyt|j|}Wn*tk rdtd|j|fnX||j|<|S(NRJsCould not resolve module %ssModule %s has no attribute '%s'(RxR?RWRJRR(RRtattr((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyR,,s   ( RR R<R>RCRDRtpropertyR?RRJR@R,(((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyR5s    ( RR R!RRRRBR<R>RCRR5(((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyR3s   cCsat|tjrW|jj}|dkr4tS|dkrDtStd |nt|S(Nttruetyestontyttt1tfalsetnotoffR'tft0sString is not true/false: %r(RMRNRORPRQRR(RSRTRUR'RVRW( RhRt string_typeststripR%RR#t ValueErrorR(R((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytasbool<s  csfd}|S(sqReturn a callable that will evaluate a string as boolean, or one of a set of "alternate" string values. cs|kr|St|SdS(N(R[(R(ttext(sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt bool_or_valueNs ((R\R]((R\sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt bool_or_strHscCs|dkr|St|S(sCoerce to integer.N(Rtint(R((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytasintWs cCs||krt|t s0t||| r||dk r|tkri|rit||||ys(RRt difference(RR+RRR[((RsN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytconstructor_copyps  cs4tjjtjdfd}|S(s%Return a threadsafe counter function.ics*jztSWdjXdS(N(tacquiretnexttrelease((tcountertlock(sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt_nexts (Rt threadingtLockR=tcount(Rk((RiRjsN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRi~scCst|dr>|jdk r4t|jtr4tS|jSnt|trStpVt}||trltS||trtS||trtSt|drtSt|drtSt|drtS|SdS(sGiven an instance or class, guess if it is or is acting as one of the basic collection types: list, set and dict. If the __emulates__ property is present, return that preferentially. t __emulates__R2RAR<N( R1RoRt issubclassR<RhRiRRT(tspecimenRtisa((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytduck_type_collections& cCst||r|St|trZtjd|djd|Dt|fn"tjd||t|fdS(Ns8Argument '%s' is expected to be one of type %s, got '%s's or css|]}d|VqdS(s'%s'N((R&R((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pys ss6Argument '%s' is expected to be of type '%s', got '%s'(RhR3Rt ArgumentErrorR(Ri(RtargtypeRM((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytassert_arg_types/cs tjr+tdrctjSn8tdrDjStdrctjStdtdd d krt dntdrfd}|Stdrtfd j DSt dd S( s?Return a (key, value) iterator for almost any dict-like object.Rt iteritemst __getitem__RsObject '%r' is not dict-liketiterkeysc3s,x%jD]}||fVq WdS(N(Ry(R(tdictliketgetter(sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytiteratorsRc3s!|]}||fVqdS(N((R&R(R{(sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pys sN( RRR1RRRwtiterRWRRR(RzR|((RzR{sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRs     t classpropertycBs eZdZdZdZRS(sAA decorator that behaves like @property except that operates on classes rather than instances. The decorator is currently special when using the declarative module, but note that the :class:`~.sqlalchemy.ext.declarative.declared_attr` decorator should be used for this purpose with declarative. cOs,tt|j||||j|_dS(N(tsuperR~RR!(RRRR((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRscCs |j|S(N(R(tdescRR+((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRs(RR R!RR(((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyR~s  thybridpropertycBseZdZdZRS(cCs ||_dS(N(R(RR((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRscCs?|dkr.|j|}|jj|_|S|j|SdS(N(RRR!(RR%townertclsval((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRs  (RR RR(((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRs t hybridmethodcBs eZdZdZdZRS(s/Decorate a function as cls- or instance- level.cCs ||_dS(N(R(RR((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRscCs9|dkr"|jj||jS|jj||SdS(N(RRRR(RR%R((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRs (RR R!RR(((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRs t_symbolcBs2eZdddZdZdZdZRS(cCsdt|tjst|dkr3t|}ntjt|}||_ |r`||_ n|S(sConstruct a new named symbol.N( RhRRXtAssertionErrorRthashR_RDRRMR!(RRMRot canonicaltv((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRD s   cCst|jdt|ffS(NR (ReRMR_(R((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt __reduce__scCs t|S(N(R(R((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt__str__scCs d|jS(Ns symbol(%r)(RM(R((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt__repr__sN(RR RRDRRR(((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyR s  RecBs2eZdZiZejjZdddZ RS(sA constant symbol. >>> symbol('foo') is symbol('foo') True >>> symbol('foo') A slight refinement of the MAGICCOOKIE=object() pattern. The primary advantage of symbol() is its repr(). They are also singletons. Repeated calls of symbol('name') will all return the same instance. The optional ``doc`` argument assigns to ``__doc__``. This is strictly so that Sphinx autoattr picks up the docstring we want (it doesn't appear to pick up the in-module docstring if the datamember is in a different module - autoattribute also blows up completely). If Sphinx fixes/improves this then we would no longer need ``doc`` here. cCsh|jjzF|jj|}|dkrNt||||j|<}n|SWdtjjXdS(N(t_lockRftsymbolsRRRReRh(R+RMRoRRF((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRD<s   N( RR R!RRRlRmRRRD(((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRe#scCst|_td7adS(sAssign a '_creation_order' sequence to the given instance. This allows multiple instances to be sorted in order of creation (typically within a single thread; the counter is not particularly threadsafe). iN(t_creation_order(R%((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytset_creation_orderJs cOsDy|||SWn,tk r?tdtjdd!nXdS(sXexecutes the given function, catches all exceptions and converts to a warning. s%s('%s') ignorediiN(RRRRR(RRR((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytwarn_exceptionWs icCsBy)t||kr$d|d|!S|SWntk r=|SXdS(Ns%s...i(RR(Rtlen_((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytellipses_stringbs  t_hash_limit_stringcBs)eZdZdZdZdZRS(s/A string subclass that can only be hashed on a maximum amount of unique values. This is used for warnings so that we can send out parameterized warnings without the __warningregistry__ of the module, or the non-overridable "once" registry within warnings.py, overloading memory, cCsT||d|}tt|j||}td|t||f|_|S(Ns6 (this warning may be suppressed after %d occurrences)s%s_%d(RRRDRt_hash(R+RtnumRt interpolatedR((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRDws  #cCs|jS(N(R(R((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt__hash__scCst|t|kS(N(R(Rtother((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt__eq__s(RR R!RDRR(((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRls   cCstj|tjdddS(sdIssue a warning. If msg is a string, :class:`.exc.SAWarning` is used as the category. t stackleveliN(twarningsRRt SAWarning(tmsg((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRscCs8|rt|d|}ntj|tjdddS(s\Issue a warning with a parameterized string, limiting the number of registrations. i RiN(RRRRR(RR((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt warn_limitedscs|gfd}|S(sNDecorate the given function to be a no-op after it is called exactly once.cs#rj}|||SdS(N(R(RRtonce_fn(tonce(sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytgos ((RHR((RsN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt only_onces s%sqlalchemy/([a-z_]+/){0,2}[a-z_]+\.pysunit(?:2|test2?/)cCsd}t|d}x-||krE|j||rE|d7}qWx-||kru|j||ru|d8}qIW|||d!S(stChop extraneous lines off beginning and end of a traceback. :param tb: a list of traceback lines as returned by ``traceback.format_stack()`` :param exclude_prefix: a regular expression object matching lines to skip at beginning of ``tb`` :param exclude_suffix: a regular expression object matching lines to skip at end of ``tb`` ii(Rtsearch(ttbtexclude_prefixtexclude_suffixR.tend((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytchop_tracebacks ""cBs)d|}ej}||U|dS(Ns&def set(obj, value): obj.%s = valueR<(Rtcopy(tattrnameR_Rc((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt attrsetters tEnsureKWArgTypecBs eZdZdZdZRS(sYApply translation of functions to accept \**kw arguments if they don't already. c Cs|j}|rxx|D]m}tj||}|r||}tj|}|js|j|||<} t||| qqqWntt |j |||dS(N( t ensure_kwargR)tmatchRRSRt _wrap_w_kwRRRR( R+tclsnameRDtclsdicttfn_regRR RHRZtwrapped((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRs    csfd}t|S(Ncs |S(N((RR(RH(sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytwraps(R(RRHR((RHsN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRs(RR R!RR(((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRs cCst|drt||S|}|jj|_t|drO|j|_nt|jdr|jjr|jj|_n|jr|j|_n|SdS(sAugment functools.update_wrapper() to work with objects with a ``__call__()`` method. :param fn: object with __call__ method RR R!N(R1RRRR RR!(twrapperRHt_f((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt wrap_callables  cCs!d|kr|jdSd}gg}d}t|}x||kr||}|dkr|dkr||dkr||ddkr|djd|d7}q|dN}n9|dkr|dkr|jgn|dj||d7}q=Wg|D]}dj|^qS(sParse a dotted identifier with accommodation for quoted names. Includes support for SQL-style double quotes as a literal character. E.g.:: >>> quoted_token_parser("name") ["name"] >>> quoted_token_parser("schema.name") ["schema", "name"] >>> quoted_token_parser('"Schema"."Name"') ['Schema', 'Name'] >>> quoted_token_parser('"Schema"."Name""Foo"') ['Schema', 'Name""Foo'] t"RdiiiR;(RjRR2R((RRRtidxtlvtcharR((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytquoted_token_parsers$      0  cs%tjfd}|S(NcsS|jdk r|jpd}|rFt|fdD}n||_|S(NR;csi|]}|qS(((R&tparam(R\(sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pys 0s (R!Rtinject_param_text(RHRo(tparamsR\(sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRa-s " (RR(RR\Ra((RR\sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytadd_parameter_text*scCsi|jdd}t|dkr(|S|\}}|jdsX|dtj|Stj|SdS(Ns iR$(RjRRttextwraptdedent(R\t split_textt firstlinet remaining((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt_dedent_docstring7s c Cst|p d}|jd}tj|jd}|drV|jddngt|D]\}}|jsc|^qc}|jdd|t|t|d}|d|!|||}dj |S(NR;s ii( RRjRRtinsertRRYtminRR(( tdoctextt injecttexttpostlinest injectlinesRtlinetblankst inject_pos((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pytinject_docstring_textCs 1c Cs|j}g}d}x|r|jd}|dkrtjd|}|r|jd}||krdt|jdd}|rtjd|d} | rdt| jd}qn|||}qqn|jjdr)|j d|j ||j dd}nt|j se|j ||j ||j dd}n8|j d r|j ||j |jdqn|j |qWdj |S( Nis(\s+):param (?:\\\*\*?)?(.+?):iR$is(\s+)\Ss:param s s::( t splitlinesRRR)RRsRtlstripRR2trstripRR(( Rt inject_paramstdoclinesRt to_injectRR Rtindenttm2((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyRSsB              ((([R!t functoolsRRROR=R R)RRRRR;RRRR RR R,R6RGRJRbRVRqRrRRRRR#RRRURRRRRRRRRRRR"R#R)R2R3R[R^R`RbReRiRsRvRRLR~RRR_RRReRRRRt text_typeRRRRtcompilet_SQLA_REt _UNITTEST_RERRitNoneTypeRRRRRRRR(((sN/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.pyt s          .      0*  + 6 S   H 3  9 V ( u      !     $      ,