o znhv: @sddZddlZddlZddlZddlZddlZejdkZejdkZejdkZ ejdkZ ejdkZ ejdkZ ejdkZ ejd Zeed Zejd Ze oOe ZejZejZejZeZed gd ZzddlZWn eyvddlZYnwe r~ddZneZddZ e rddl!Z!ddl"Z"ddl#Z#ddl$Z$ddl%Z%ddl&m'Z'ddl(m)Z*ddl(m+Z+ddl$m,Z,ddl-m.Z.m/Z/m0Z0m1Z1m2Z2efZ3e4fZ5e4Z6eZ7e8fZ9e:Z;e$jZ?e@ZAeBe"dZCeBe"dZDeBe"dZEddZFddZGddZHd d!ZId"d#ZJdWd$d%ZKd&d'ZLd(d)ZMe r eNZNnd*d+ZNnddl!Z!ddlOZ#ddl$Z$ddl+m+Z+ddlPm+Z*dd,l$mQZ,dd-lRm1Z1dd.lRm.Z.dd/lRm2Z2dd0lRm/Z/dd1lSm0Z0zddlTZ%Wneybddl%Z%YnweUfZ3e4fZ5eZ6eVZ7e8eWfZ9eNZNeJZJe'Z'e!jHZHe!jGZGe$jXZ=e$jYZ?e$jZZAd2dZFdXd3d4ZCd5d6Z;d7d8ZDd9d:ZEd;d'ZLdd?Z[e\d@e rddAlm]Z]ddddBiiedCddDddEddFde]f dGdHZ^ne rddIlm_Z`dJdHZ^nddIlm_Z^erddlambZcnddlZcejdKdLZddXdMdNZedOdPZfe rddQlgmhZhdSddRlgmgZgddSlgmiZiddTlgmjZjGdUdVdVejZheheideh_kdS)Yz1Handle Python version/platform incompatibilities.N))rr)r)r)rr)rrrjavapypy_version_infowin FullArgSpec)argsvarargsvarkwdefaults kwonlyargskwonlydefaults annotationscC|SN)argrrA/usr/local/lib/python3.10/dist-packages/sqlalchemy/util/compat.py7src Cst|r|j}t|std||j}t|s#td||j}|j }t r.|j nd}t |d|}t ||||}||7}d}|j tj@rW|j |}|d}d}|j tj@rd|j |}t||||j|t rp|jndt rw|jSiS)z9Fully vendored version of getfullargspec from Python 3.3.z{!r} is not a Python functionz{!r} is not a code objectrN)inspectismethod__func__ isfunction TypeErrorformat__code__iscode co_argcount co_varnamespy3kco_kwonlyargcountlistco_flags CO_VARARGSCO_VARKEYWORDSr __defaults____kwdefaults____annotations__) funcconargsnamesnkwargsr rr r rrrinspect_getfullargspec<s>        r0)reduce)BytesIO)StringIO) zip_longest) quote_plus unquote_plus parse_qslquoteunquoteexec __import__printcCs |dS)Nzlatin-1)encodesrrrb r@cCst|dSNascii)base64 b64decoder=xrrrrErEcCst|dSrB)rD b64encodedecoderFrrrrIrHrIcCs|j|ddS)Nbackslashreplaceerrors)rJtextencodingrrrdecode_backslashreplacerQcCs||k||kSrr)ar@rrrcmprHrTcCs6|dur||us Jd||_|j|ur|||)NzSame cause emitted) __cause__ __traceback__with_traceback)tpvaluetbcauserrrreraises   r\cCrrrr>rrrur]cCrrrr>rrruer^r_cC t|dS)N__call__)hasattr)fnrrrcallablerArd) izip_longest)r8)r5)r9)r6)r7cCrrrr>rrrr@r^cCs |dur tddStddS)Nzexec func_text in globals_zexec func_text in globals_, lcl)r:) func_textglobals_lclrrrexec_s  ricCsdd|DS)Ncss|]}t|VqdSr)ord).0byterrr sziterbytes..r)bufrrr iterbytesrRrocGs4t|dkr|dddd|dDf}t|S)NrrcSsg|]}t|qSr)str)rkrrrr szimport_..)lenr;)r rrrimport_s  rtcOsH|dtj}|dur dSt|D]}t|tst|}||qdS)Nfile)popsysstdout enumerate isinstance basestringrqwrite)r kwargsfprrrrprint_s   rcCr`)Nzutf-8unicoder>rrrr]s cCr`)Nunicode_escaperr>rrrr_rAcCs4z||WStyt|ddYSw)Nr)rJUnicodeDecodeErrorreprrNrrrrQs   cCs8t|tst|jdddSt|tr|jdddS|S)NrCrKrL)rz string_typesrr=rOrrrsafe_bytestrings  rzdef reraise(tp, value, tb=None, cause=None): if cause is not None: assert cause is not value, 'Same cause emitted' raise tp, value, tb )formatannotationrcCd|S)N*rnamerrrrcCr)Nz**rrrrrrrcCs dt|S)N=)r)rYrrrrs cCr)Nz -> rrrrrrrc sfdd} g}|rt|t|}t|D]\}}| |}|r0||kr0|| |||}||q|durD||| |n|rK|d|ri|D]}| |}|rc||vrc|| ||7}||qO|durv|| | |dd|d}dvr|| d7}|S) aaCopy formatargspec from python 3.7 standard library. Python 3 has deprecated formatargspec and requested that Signature be used instead, however this requires a full reimplementation of formatargspec() in terms of creating Parameter objects and such. Instead of introducing all the object-creation overhead and having to reinvent from scratch, just copy their compatibility routine. Utimately we would need to rewrite our "decorator" routine completely which is not really worth it right now, until all Python 2.x support is dropped. cs(|}|vr|d|7}|S)Nz: r)rresultrr formatargrrformatargandannotation-sz5inspect_formatargspec..formatargandannotationNr(z, )return)rsryappendjoin)r r r r rrrr formatvarargs formatvarkw formatvalue formatreturnsrrspecs firstdefaultirspec kwonlyargrrrrinspect_formatargspecs2     r) formatargspeccOst|ddi|S)Nrrp)_inspect_formatargspec)rkwrrrrUsc gs g}g}d}zRz|D]}|j}|j}||||q |VWnt}YW|rF|}z||r:d}Wnt}Y|s/|dkrXt|d|d|ddSdS|rs|}z||rgd}Wnt}Y|s\|dkrt|d|d|dww)zImplement contextlib.nested, mostly for unit tests. As tests still need to run on py2.6 we can't use multiple-with yet. Function is removed in py3k but also emits deprecation warning in 2.7 so just roll it here for everyone. )NNNrrrN)__exit__ __enter__rrwexc_inforvr\)managersexitsvars_excmgrexit_enterrrrnestedfsL       rcCsB|durt}|\}}}||ur|nd}tt||||ddS)N)rZr[)rwrr\type) exceptionrexc_type exc_valueexc_tbr[rrrraise_from_causes  rcs"Gfddd}|ddiS)zCreate a base class with a metaclass. Drops the middle class upon creation. Source: http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/ cs&eZdZejZejZfddZdS)z!with_metaclass..metaclasscs$|dur t||d|S||S)Nr)r__new__)clsr this_basesdbasesmetarrrs z)with_metaclass..metaclass.__new__N)__name__ __module__ __qualname__rra__init__rrrrr metaclasssrtemporary_classNr)rrrrrrwith_metaclasss r)timezone)datetime timedelta)tzinfoc@seZdZdZdZddZddZddZd d Zd d Z d dZ ddZ ddZ ddZ eddZeddZeddZedddZe ZdS)rz(Minimal port of python 3 timezone object_offsetcCsDt|ts td|j|kr|jkstdtd||_dS)Nzoffset must be a timedeltazYoffset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24).)rzrr _minoffset _maxoffset ValueErrorr)selfoffsetrrrrs  ztimezone.__init__cCst|tkrdS|j|jkS)NF)rrr)rotherrrr__eq__s  ztimezone.__eq__cCs t|jSr)hashrrrrr__hash__rAztimezone.__hash__cCsd|jj|jfS)Nzsqlalchemy.util.%s(%r)) __class__rrrrrr__repr__sztimezone.__repr__cCs |dSr)tznamerrrr__str__rAztimezone.__str__cCs|jSr)rrdtrrr utcoffsetsztimezone.utcoffsetcCs ||jSr)_name_from_offsetrrrrrrs ztimezone.tznamecCsdSrrrrrrdstr^z timezone.dstcCs.t|tr|j|urtd||jStd)Nzfromutc: dt.tzinfo is not selfz6fromutc() argument must be a datetime instance or None)rzrrrrrrrrrfromutcs   ztimezone.fromutccCs|jd|jd|jS)z(backport of timedelta._to_microseconds()iQi@B)daysseconds microsecondsrrrr_timedelta_to_microsecondss z#timezone._timedelta_to_microsecondscCs*tt|t|\}}|tdd|fS)z backport of timedelta.__divmod__r)divmodrrr)rSr@qrrrr_divmod_timedeltass ztimezone._divmod_timedeltascCs|sdS|tdkrd}| }nd}t|tdd\}}t|tdd\}}d|||f}|jr:|d |jf7}|jrE|d |jf7}|S) NUTCr-+r)hours)minuteszUTC%s%02d:%02dz:%02dz.%06d)rrrrr)deltasignrrestrrrrrrs$   ztimezone._name_from_offset;)rrN)rrr__doc__ __slots__rrrrrrrrr staticmethodrrrrrrrrrrrs(      r)NNr)lr collections contextlibroperatorrw version_infopy36py33py35py32r"py2kpy265platform startswithjythonrbpypywin32cpythoncontextmanager attrgetter dottedgetter namedtuplenextr threading ImportErrordummy_threading safe_kwargrqr0rDbuiltins configparser itertoolspickle functoolsr1ior2 byte_bufferr3r4 urllib.parser5r6r7r8r9rbytes binary_types binary_type text_typeint int_typesiterro filterfalseitertools_filterfalsefilteritertools_filtermapitertools_imapgetattrrirtrr@rErIrQrTr\r]r_rd ConfigParser cStringIOreurlliburlparsecPickler{rlong ifilterfalseifilterimaprr:rrrrcollections.abcabccollections_abcrrrrrrrutcrrrrs               &                         B     "   ]