ó
    øÞ jÀ=  ã                  ó–  • S SK Jr  S SKJr  S SKJr  S SKrS SKrS SKrS SKJ	r	  S SK
r
S SKrS SKrS SKrS SKrS SKJr  S SKJr  S SKrS SKrS SKJr  S	S
KJr  S	SKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ r   SSKJ!r!  SSKJ"r"  SSK#Jr  SSK$J%r%  SSK&J'r'  SSK&J(r(  SSK&J)r)  SSK&J*r*  \)(       d  S r+\+=r,r-O\R\                  r,S r-S r/S r0S8S jr1S  r2 " S! S"\35      r4S# r5S$ r6S% r7S& r8S' r9S( r:\'S) 5       r;S* r<S+ r=S, r>S9S- jr?S. r@ " S/ S0\A5      rBS1 rC   S:S3 jrDS4 rES5 rFS6 rG\R�                  S2S;S7 jj5       rIg)<é    )Úannotations)Údeque)Ú
namedtupleN)Úchain)Ú	getsizeof)Úmkstemp)ÚAnyé   )Úconfig)Úmocké   )Úinspect)Ú
Connection)ÚColumn)ÚDropConstraint)Ú	DropTable)ÚForeignKeyConstraint)ÚMetaData)ÚTable©Úschema)ÚInteger©Ú	decorator)Údefaultdict)Úhas_refcount_gc)Úinspect_getfullargspecc                 óX   • [         R                  " 5         [         R                  " 5         g ©N)ÚgcÚcollect)Úargss    ÚQ/var/www/html/gaurav/venv/lib/python3.13/site-packages/sqlalchemy/testing/util.pyÚnon_refcount_gc_collectr$   0   s   € Ü
�
Š
ŒÜ
�
Š
�ó    c                 ó   • g r   © r'   r%   r#   Úlazy_gcr(   9   s   € Ør%   c               #  ó¬   ^#   • [        SSS/5      n [        S[        R                  S-   5       H   mU " [        R                  U4S j5      v •  M"     g 7f)NÚpicklersÚloadsÚdumpséþÿÿÿr
   c                ó2   >• [         R                  " U T5      $ r   )Úpickler,   )ÚdÚprotocols    €r#   Ú<lambda>Úpicklers.<locals>.<lambda>A   s   ø€ ¬¯ª°a¸Ô)Br%   )r   Úranger/   ÚHIGHEST_PROTOCOLr+   )Úntr1   s    @r#   r*   r*   =   sE   øé € Ü	�J ¨'Ð 2Ó	3€Bä˜"œf×5Ñ5¸Ñ9Ö:ˆÙ”—‘ÔBÓCÔCò ;ùs   ƒAAc           
     ó’  • [        S5      u  p# [        R                  " US5       n[        R                  " X5        SSS5        [        [        R                  5      n[        R                  R                  S5      (       a"  UR                  [        R                  S   5        [        R                  " [        R                  SXR                  [        R                  S5      /[        R                   [        R                   0 [        R                  ES[        R"                  R%                  U5      0ES9n[        R&                  " U5        UR(                  S:w  a%  [+        S	UR,                  R/                  S
S9-  5      eUR0                  R3                  5       $ ! , (       d  f       GNf= f! [        R&                  " U5        f = f)a©  pickle ``obj`` to a file, then unpickle it in a new interpreter.

``code`` is Python source run by that interpreter, which receives the
name of the pickle file as ``sys.argv[1]``.  The new interpreter has
the current ``sys.path``, so that the SQLAlchemy under test, as well
as the ``test`` package, are importable.

Returns the stripped stdout of the subprocess; a non-zero exit status
fails the test, reporting its stderr.

ÚpklÚwbNÚ
PYTHONPATHz-cÚ/)ÚstdoutÚstderrÚenvr   zsubprocess failed: %sÚreplace)Úerrors)r   ÚosÚfdopenr/   ÚdumpÚlistÚsysÚpathÚenvironÚgetÚappendÚ
subprocessÚrunÚ
executabler?   ÚsepÚPIPEÚpathsepÚjoinÚunlinkÚ
returncodeÚAssertionErrorr=   Údecoder<   Ústrip)ÚobjÚcodeÚfdÚfilenameÚfile_ÚpartsÚprocs          r#   Úunpickle_in_subprocessr]   D   s5  € ô ˜5“>�L€BðÜ�YŠY�r˜4Ô  EÜ�KŠK˜Ô#÷ !ô ”S—X‘X“ˆÜ�:‰:�>‰>˜,×'Ñ'Ø�L‰LœŸ™ LÑ1Ô2ä�~Š~Ü�^‰^˜T 4×)9Ñ)9¼"¿&¹&À#Ó)FÐGÜ—?‘?Ü—?‘?ØD”2—:‘:ÐD˜|¬R¯Z©Z¯_©_¸UÓ-CÑDñ	
ˆô 	�	Š	�(Ôà‡�˜!ÓÜØ# d§k¡k×&8Ñ&8À	Ð&8Ð&JÑJó
ð 	
ð �;‰;×ÑÓÐ÷) !Ö ûô 	�	Š	�(Õús"   �F. ¦F½C:F. Æ
F+Æ&F. Æ.Gc                ó*   • [         R                  " XS9$ )N)Úk)ÚrandomÚchoices)Ú
populationr_   s     r#   Úrandom_choicesrc   j   s   € Ü�>Š>˜*Ñ*Ð*r%   c                óÔ   • [        U [        5      (       a  [        X5      $ U [        R                  " SSU-  -   5      -  R                  [        R                  5      [        SU5      -  $ )NÚ1Ú0é
   )Ú
isinstanceÚfloatÚroundÚdecimalÚDecimalÚto_integralÚROUND_FLOORÚpow)ÚvalueÚprecs     r#   Úround_decimalrr   n   s]   € Ü�%œ×ÑÜ�UÓ!Ð!ð ”G—O’O C¨#°©*Ñ$4Ó5Ñ5×BÑBÜ×ÑóäˆB�‹ñð r%   c                  ó8   • \ rS rSrS rS rS rS rS rS r	Sr
g	)
Ú	RandomSetéx   c                ó€   • [        [        R                  U 5      5      n[        R                  " U5        [        U5      $ r   )rD   ÚsetÚ__iter__r`   ÚshuffleÚiter)ÚselfÚls     r#   rx   ÚRandomSet.__iter__y   s*   € Ü”—‘˜dÓ#Ó$ˆÜ�Š�qÔÜ�A‹wˆr%   c                ó°   • [         R                  " S[        U 5      S-
  5      n[        [        R                  U 5      5      U   nU R                  U5        U$ )Nr   r
   )r`   ÚrandintÚlenrD   rw   rx   Úremove)r{   ÚindexÚitems      r#   ÚpopÚRandomSet.pop~   sC   € Ü—’˜q¤# d£)¨a¡-Ó0ˆÜ”C—L‘L Ó&Ó'¨Ñ.ˆØ�‰�DÔØˆr%   c                ó>   • [        [        R                  X5      5      $ r   )rt   rw   Úunion©r{   Úothers     r#   r‡   ÚRandomSet.union„   s   € ÜœŸ™ 4Ó/Ó0Ð0r%   c                ó>   • [        [        R                  X5      5      $ r   )rt   rw   Ú
differencerˆ   s     r#   rŒ   ÚRandomSet.difference‡   s   € ÜœŸ™¨Ó4Ó5Ð5r%   c                ó>   • [        [        R                  X5      5      $ r   )rt   rw   Úintersectionrˆ   s     r#   r�   ÚRandomSet.intersectionŠ   s   € Üœ×)Ñ)¨$Ó6Ó7Ð7r%   c                ó   • [        U 5      $ r   )rt   )r{   s    r#   ÚcopyÚRandomSet.copy�   s   € Ü˜‹Ðr%   r'   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__rx   r„   r‡   rŒ   r�   r’   Ú__static_attributes__r'   r%   r#   rt   rt   x   s    † òò
ò1ò6ò8õr%   rt   c                ó²   • [        [        5      nU  H  u  p4X#   R                  U5        M     [        U5       H  u  pVXS  H  nXbU   ;   d  M      g   M     g)zATrue if the given sorting conforms to the given partial ordering.NFT)r   rw   ÚaddÚ	enumerate)ÚtuplesÚsorted_elementsÚdepsÚparentÚchildÚiÚnodeÚns           r#   Úconforms_partial_orderingr¤   ‘   s[   € ô ”sÓ€DÛ‰ˆØ‰×Ñ˜Öñ  ä˜_Ö-‰ˆØ  Ó$ˆAØ˜A‘w�Úó %ñ .ð
 r%   c                ó’   ^^• [        [        5      mU  H  u  p#TU   R                  U5        M     UU4S jm[        T" U5      5      $ )Nc              3  óô   >#   • [        U 5      S:X  a  [        U 5      v •  g U  HP  n[        U 5      R                  U/5      nUR	                  TU   5      (       a  M9  T" U5       H  nU/U-   v •  M     MR     g 7f)Nr
   )r€   rD   rw   rŒ   r�   )ÚelementsÚelemÚsubsetÚsub_orderingÚ_all_orderingsÚedgess       €€r#   r«   Ú-all_partial_orderings.<locals>._all_orderings¤   sm   øé € Üˆx‹=˜AÓÜ�x“.Ó ã �Ü˜X›×1Ñ1°4°&Ó9�Ø×*Ñ*¨5°©;×7Ó7Ù(6°vÖ(>˜Ø#˜f |Ñ3Ô3ó )?ò !ùs   ƒAA8ÁA8)r   rw   rš   rz   )rœ   r§   rŸ   r    r«   r¬   s       @@r#   Úall_partial_orderingsr®   Ÿ   sB   ù€ ÜœÓ€EÛ‰ˆØˆe‰×Ñ˜Ö ñ  ö4ô ‘˜xÓ(Ó)Ð)r%   c                ó¸   •  Xl         U $ ! [         aE    [        R                  " U R                  U R
                  XR                  U R                  5      n  U $ f = f)aK  Return a function with a given __name__.

Will assign to __name__ and return the original function if possible on
the Python implementation, otherwise a new function will be constructed.

This function should be phased out as much as possible
in favor of @decorator.   Tests that "generate" many named tests
should be modernized.

)r”   Ú	TypeErrorÚtypesÚFunctionTypeÚ__code__Ú__globals__Ú__defaults__Ú__closure__)ÚfnÚnames     r#   Úfunction_namedr¹   ±   sT   € ð
ØŒð
 €Iøô	 ó 
Ü×ÒØ�K‰K˜Ÿ™¨¯©ÀÇÁó
‰ð €Ið	
ús   ‚
 ŠAAÁAc                óÐ   • U R                  5       n U" U/UQ70 UD6nU R                  SSS5        U$ !   [        R                  " 5       nU R                  " U6 nU(       d  e Us $ = f)zÿRun the given function under the given contextmanager,
simulating the behavior of 'with' to support older
Python versions.

This is not necessary anymore as we have placed 2.6
as minimum Python version, however some tests are still using
this structure.

N)Ú	__enter__Ú__exit__rE   Úexc_info)Úctxr·   ÚargÚkwrV   Úresultr½   Úraise_s           r#   Úrun_as_contextmanagerrÃ   Å   sh   € ð �-‰-‹/€Cð
Ù�CÐ$˜#Ò$ Ñ$ˆØ�‰�T˜4 Ô&ØˆøðÜ—<’<“>ˆØ—’˜xÐ(ˆÞØàŠMús	   ’ 3 ³0A%c                óB   • U  Vs1 sH  n[        U5      iM     sn$ s  snf )z‚Converts the results of sql execution into a plain set of column tuples.

Useful for asserting the results of an unordered query.
©Útuple)ÚresultsÚrows     r#   ÚrowsetrÉ   Þ   s    € ñ #*Ó*¡'˜3ŒE�#ŽJ¡'Ñ*Ð*ùÒ*s   …c                ó   •  U 5       er   r'   )Úmsgs    r#   ÚfailrÌ   ç   s   € Ø�#Óˆ5r%   c                óx  • SSK Jn  [        R                  " 5       nUS   n[	        USS5      nXEl         U " U0 UD6UR                  5         UR                  R                  nU(       a0  [        XG5        UR                  5       R                  5         Xel        $ [        U[        R                  5        Xel        $ ! UR                  5         UR                  R                  nU(       a0  [        XG5        UR                  5       R                  5         Xel        f [        U[        R                  5        Xel        f = f)zlProvide bound MetaData for a single test, dropping afterwards.

Legacy; use the "metadata" pytest fixture.

r
   )Úfixturesr   ÚmetadataN)Ú rÎ   r   r   ÚgetattrrÏ   Úclose_all_sessionsÚbaseÚ_connection_fixture_connectionÚdrop_all_tables_from_metadataÚget_transactionÚcommitr   Údb)r·   r"   rÀ   rÎ   rÏ   r{   Ú	prev_metaÚcfcs           r#   Úprovide_metadatarÛ   ë   sÿ   € õ ä�ŠÓ €HØ�‰7€DÜ˜˜j¨$Ó/€IØ„Mð"Ù�4ˆ˜2‰ð 	×#Ñ#Ô%ð �m‰m×:Ñ:ˆÞô *¨(Ô8ð
 ×ÑÓ!×(Ñ(Ô*ð "�ô *¨(´F·I±IÔ>Ø!�øð# 	×#Ñ#Ô%ð �m‰m×:Ñ:ˆÞô *¨(Ô8ð
 ×ÑÓ!×(Ñ(Ô*ð "�ô *¨(´F·I±IÔ>Ø!�ús   µB: Â:A?D9c            
     óX  ^• [        5       nU  H  mUR                  T5        M     [        U5      n[        R                  " U  V^s/ sH5  mSR                  U4S jU 5       5      4[        U4S jU 5       5      -   PM7     snSS[        U5      -  -   SR                  U5      S.6$ s  snf )a  A facade around @testing.combinations() oriented towards boolean
keyword-based arguments.

Basically generates a nice looking identifier based on the keywords
and also sets up the argument names.

E.g.::

    @testing.flag_combinations(
        dict(lazy=False, passive=False),
        dict(lazy=True, passive=False),
        dict(lazy=False, passive=True),
        dict(lazy=False, passive=True, raiseload=True),
    )
    def test_fn(lazy, passive, raiseload): ...

would result in::

    @testing.combinations(
        ("", False, False, False),
        ("lazy", True, False, False),
        ("lazy_passive", True, True, False),
        ("lazy_passive", True, True, True),
        id_="iaaa",
        argnames="lazy,passive,raiseload",
    )
    def test_fn(lazy, passive, raiseload): ...

Ú_c              3  óX   >#   • U H   nTR                  US 5      (       d  M  Uv •  M"     g7f©FN©rH   ©Ú.0r_   r0   s     €r#   Ú	<genexpr>Ú$flag_combinations.<locals>.<genexpr>?  s   øé € Ð9¡˜A¨¯©¨q°%¯—a‘a¢ùs   ƒ*¡	*c              3  óF   >#   • U H  nTR                  US 5      v •  M     g7frß   rà   rá   s     €r#   rã   rä   @  s   øé € Ð2©T¨�A—E‘E˜!˜U—O�OªTùs   ƒ!r¡   ÚaÚ,)Úid_Úargnames)rw   ÚupdateÚsortedr   ÚcombinationsrP   rÆ   r€   )rì   Úkeysr0   s     `r#   Úflag_combinationsrî     s¥   ø€ ô> ‹5€DãˆØ�‰�AŽñ ô �$‹<€Dä×Òñ "ô

ñ "�ð �X‰XÔ9¡Ó9Ó9Ð;ÜÔ2©TÓ2Ó2ô3á!ñ

ð
 �3œ˜T›‘?Ñ#Ø—‘˜$“òð ùò

s   Á;B'c                ó  ^ • [        T 5      nT " US    Vs/ sH  n[        R                  " 5       PM     sn6 nU 4S jn[        R                  " [        [        U5      5       Vs/ sH  oe" U5      4PM     sn0 UD6$ s  snf s  snf )Nr   c                ó,   >^ • UU 4S jnST -  Ul         U$ )Nc                 ó   >• T" S0 U D6T   $ )Nr'   r'   )rÀ   Úlambda_arg_setsÚposs    €€r#   ÚfixtureÚ<lambda_combinations.<locals>.create_fixture.<locals>.fixtureN  s   ø€ Ù"Ñ( RÑ(¨Ñ-Ð-r%   zfixture_%3.3d)r”   )ró   rô   rò   s   ` €r#   Úcreate_fixtureÚ+lambda_combinations.<locals>.create_fixtureM  s   ù€ ö	.ð +¨SÑ0ˆÔØˆr%   )r   r   ÚMockr   rì   r4   r€   )rò   rÀ   r"   r¿   Úarg_setsrö   r¡   s   `      r#   Úlambda_combinationsrú   H  s‚   ø€ Ü! /Ó2€Dá¸¸QºÓ @¹°¤§¢¦¹Ñ @ÐA€Hõô ×ÒÜ(-¬c°(«mÔ(<Ó	=Ñ(< 1ˆ>˜!ÓÓ
Ñ(<Ñ	=ðØACñð ùò !Aùò 
>s   –A<Á$Bc                ó  • [        U 5      S   nU Vs0 sH  o3UR                  U5      _M     nn[        U R                  5      nUR	                  U5        [
        R                  " U R                  U5      nU" S0 UD6$ s  snf )zÍGiven a no-arg lambda and a namespace, return a new lambda that
has all the values filled in.

This is used so that we can have module-level fixtures that
refer to instance-level variables using lambdas.

r   r'   )r   r„   Údictr´   rê   r±   r²   r³   )Ú__fnrÀ   Úpos_argsr¿   Úpass_pos_argsÚglbÚnew_fns          r#   Úresolve_lambdar  Y  sv   € ô & dÓ+¨AÑ.€HÙ19Ó:±¨#˜"Ÿ&™& ›+Ò%±€MÐ:Ü
ˆt×ÑÓ
 €CØ‡J�Jˆr„NÜ×Ò §¡¨sÓ3€FÙÑ"�MÑ"Ð"ùò	 ;s   “A>c                ó   ^ • U 4S jnU$ )z&Provide MetaData for a pytest fixture.c                óF   >^ • U 4S jn[         R                  " TS9" U5      $ )Nc              3  ó"  >#   • [         R                  " 5       =ol         T" X5      nUR                  [        R
                  5        Uv •  UR                  [        R
                  5        g ! UR                  [        R
                  5        f = f7fr   )r   r   rÏ   Ú
create_allr   rØ   Údrop_all)r{   rÏ   rÁ   r·   s      €r#   Úrun_ddlÚ3metadata_fixture.<locals>.decorate.<locals>.run_ddln  sc   øé € Ü'-§¢Ó'8Ð8ˆH”}ð-Ù˜DÓ+�Ø×#Ñ#¤F§I¡IÔ.ð ’à×!Ñ!¤&§)¡)Õ,ø�×!Ñ!¤&§)¡)Õ,üs   ƒB +A+ Á BÁ+!BÂB)Úscope)r   rô   )r·   r  Úddls   ` €r#   ÚdecorateÚ"metadata_fixture.<locals>.decoratem  s   ù€ õ		-ô �~Š~ CÒ(¨Ó1Ð1r%   r'   )r  r  s   ` r#   Úmetadata_fixturer  j  s   ø€ õ2ð €Or%   c                 ó&   ^ • [         U 4S j5       nU$ )zaForce the given table names to be dropped after test complete,
isolating for foreign key cycles

c                óà   >•  U " U0 UD6[        [        R                  [        [        R                  5      TS9  $ ! [        [        R                  [        [        R                  5      TS9  f = f)N)Úinclude_names)Údrop_all_tablesr   rØ   r   )r·   r"   rÀ   Únamess      €r#   ÚgoÚforce_drop_names.<locals>.go„  sG   ø€ ð	PÙ�t�?˜r‘?äœFŸI™I¤w¬v¯y©yÓ'9ÈÓOøŒOœFŸI™I¤w¬v¯y©yÓ'9ÈÓOús	   ƒ; »2A-r   )r  r  s   ` r#   Úforce_drop_namesr  ~  s    ø€ ô ôPó ðPð €Ir%   c                  ó(   • \ rS rSrSrS rS r\rSrg)ÚadictiŽ  z,Dict keys available as attributes.  Shadows.c                óV   •  X   $ ! [          a    [        R                  X5      s $ f = fr   )ÚKeyErrorrü   Ú__getattribute__)r{   Úkeys     r#   r  Úadict.__getattribute__‘  s/   € ð	4Ø‘9ÐøÜó 	4Ü×(Ñ(¨Ó3Ò3ð	4ús   ‚ †(§(c                óF   • [        U Vs/ sH  o U   PM	     sn5      $ s  snf r   rÅ   )r{   rí   r  s      r#   Ú__call__Úadict.__call__—  s!   € Ü©4Ó0©4 C˜3”i©4Ñ0Ó1Ð1ùÒ0s   Šr'   N)	r”   r•   r–   r—   Ú__doc__r  r  Úget_allr˜   r'   r%   r#   r  r  Ž  s   † Ù6ò4ò2ð ƒGr%   r  c                óÂ   ^ ^• SSK Jm  UU 4S jn[        U[        5      (       d"  UR	                  5        nU" U5        S S S 5        g U" U5        g ! , (       d  f       g = f)Nr
   )Úenginesc                ó  >• TR                   R                  U 5        U R                  R                  (       d1  SSKJn  UR                  SSS9   TR                  U 5        S S S 5        g TR                  U 5        g ! , (       d  f       g = f)Nr
   )Ú
assertionszCan't sort tablesF)Úassert_)Útesting_reaperÚprepare_for_drop_tablesÚdialectÚsupports_alterrÐ   r&  Úexpect_warningsr  )Ú
connectionr&  r$  rÏ   s     €€r#   r  Ú)drop_all_tables_from_metadata.<locals>.go   sv   ø€ Ø×Ñ×6Ñ6°zÔBà×!Ñ!×0×0Ý$à×+Ñ+Ø#¨Uð ,ò ð ×!Ñ! *Ô-÷ð ð
 ×Ñ˜jÕ)÷õ ús   ÁA;Á;
B	)rÐ   r$  rh   r   Úbegin)rÏ   Úengine_or_connectionr  r-  r$  s   `   @r#   rÕ   rÕ   �  sL   ù€ Ýö*ô Ð*¬J×7Ñ7Ø!×'Ñ'Ô)¨ZÙˆzŒN÷ *Ð)ñ 	ÐÕ ÷ *Õ)ús   µ	AÁ
Ar   c                óö  • Ub  [        U5      nUb  US:X  d   S5       eU4nU R                  5        n[        UR                  US95       GH  u  pgU(       aA  Ub  US   U;  a  M  UR	                  [        [        US   [        5       US   S95      5        MN  U(       d  MW  U R                  R                  (       d  Mt  U H—  u  p‰Ub  US   U;  a  M  [        US   [        5       [        S[        5      [        S[        5      US   S9n
UR	                  [        [        U
R                  R                  /U
R                  R                   /U	S	95      5        M™     GM     S S S 5        g ! , (       d  f       g = f)
Nr   z2consider_schemas and schema are mutually exclusive)Úconsider_schemasr
   r   r   ÚxÚy)r¸   )rw   r/  ÚreversedÚ%sort_tables_on_foreign_key_dependencyÚexecuter   r   r   r*  r+  r   r   r   r   Úcr3  r4  )ÚengineÚ	inspectorr   r2  r  ÚconnÚ	table_keyÚfkcsÚt_keyÚfkcÚtbs              r#   r  r  ´  sd  € ð Ñ Ü˜MÓ*ˆàÑØð $
ó 
ð 	@à?ó	@ð 
ð #˜9Ðà	�‰Œ˜4Ü'Ø×;Ñ;Ø!1ð <ð ÷ 
‰OˆIö
 à!Ñ-Ø! !™¨MÓ9áØ—‘ÜÜ˜i¨™l¬H«J¸yÈ¹|ÑLóö÷
 �Ø—~‘~×4×4ÙÛ"&‘J�Eà%Ñ1Ø! !™H¨MÓ9á ÜØ˜a™Ü ›
Ü˜s¤GÓ,Ü˜s¤GÓ,Ø$ Q™xñ�Bð —L‘LÜ&Ü0°"·$±$·&±&°¸B¿D¹D¿F¹F¸8È#ÑNóöô #'ñ' 
÷ 
�Žús   ²A,E*Â"B?E*Å*
E8c                ó&   ^ • [         U 4S j5       nU$ )Nc                ó`   >•  U " U0 UD6TR                  5         $ ! TR                  5         f = fr   )Ú_clear)r·   r¿   rÀ   Ú	event_clss      €r#   r  Ú!teardown_events.<locals>.decorateí  s,   ø€ ð	Ù�s�>˜b‘>à×ÑÕøˆI×ÑÕús   ƒ ›-r   )rD  r  s   ` r#   Úteardown_eventsrF  ì  s   ø€ Üôó ðð €Or%   c                óÐ   ^^^^• S n[         [        [        [        [        [        [        U[
        [        [        [        0m[        5       m[        S5      mUUUU4S jmT" U 5      $ )z„Returns the approximate memory footprint an object and all of its
contents.

source: https://code.activestate.com/recipes/577504/


c                óJ   • [         R                  " U R                  5       5      $ r   )r   Úfrom_iterableÚitems)r0   s    r#   Údict_handlerÚ total_size.<locals>.dict_handler   s   € Ü×"Ò" 1§7¡7£9Ó-Ð-r%   r   c           
     ó  >• [        U 5      T;   a  gTR                  [        U 5      5        [        U T5      nTR                  5        H6  u  p#[	        X5      (       d  M  U[        [        TU" U 5      5      5      -  n  U$    U$ )Nr   )Úidrš   r   rJ  rh   ÚsumÚmap)ÚoÚsÚtypÚhandlerÚall_handlersÚdefault_sizeÚseenÚsizeofs       €€€€r#   rX  Útotal_size.<locals>.sizeof  su   ø€ Üˆa‹5�D‹=ØØ�‰”�A“ŒÜ�a˜Ó&ˆà(×.Ñ.Ö0‰LˆCÜ˜!×!Ó!Ø”Sœ˜V¡W¨Q£ZÓ0Ó1Ñ1�ØØˆñ	 1ð ˆr%   )rÆ   rz   rD   r   rü   rw   Ú	frozensetr   )rQ  rK  rU  rV  rW  rX  s     @@@@r#   Ú
total_sizer[  ÷  sW   û€ ò.ô 	ŒtÜŒdÜŒtÜˆlÜŒTÜ”4ð€Lô ‹5€DÜ˜Q“<€L÷
ð 
ñ �!‹9Ðr%   c                óÖ   • U /n[        5       nSnU(       aR  UR                  S5      nXBL a  US-  nO.[        U[        5      (       a  U(       a  [	        U5      U/-   U-   nU(       a  MR  U$ )z„given a cache key tuple, counts how many instances of actual
tuples are found.

used to alert large jumps in cache key complexity.

r   r
   )Úobjectr„   rh   rÆ   rD   )ÚtupÚstackÚsentinelÚnum_elementsr¨   s        r#   Úcount_cache_key_tuplesrb    sk   € ð ˆE€Eä‹x€HØ€Læ
Ø�y‰y˜‹|ˆØÒØ˜AÑ‰LÜ˜œe×$Ñ$ÞÜ˜T›
 h ZÑ/°%Ñ7�÷ ˆ%ð Ðr%   c           	   #  ó  #   • [         R                   " 5       nS v •  [         R                   " 5       U-
  nX0:”  a'   U" 5         [        R                  " SUS SU  S35        g g ! [        R                  " SUS SU  S35        f = f7f)Nztest took too long (z.4fz seconds > Ú))Útimer   Ú	skip_test)ÚsecondsÚcleanupÚnowÚsecs       r#   Úskip_if_timeoutrk  3  s€   é € ô �)Š)‹+€CÛ	Ü
�)Š)‹+˜Ñ
€CØ
ƒ}ð	ÙŒIä×ÒØ& s¨3 i¨{¸7¸)À1ÐEõð	 øô ×ÒØ& s¨3 i¨{¸7¸)À1ÐEõüs   ‚7BºA! Á BÁ! BÂB)r
   )Úfunction)Nr   N)rg  ri   rh  r	   )JÚ
__future__r   Úcollectionsr   r   Ú
contextlibrk   r    Ú	itertoolsr   rA   r/   r`   rJ   rE   r   Útempfiler   re  r±   Útypingr	   rÐ   r   r   r   r9  r   r   r   r   r   r   r   r   ÚsqlÚsql.sqltypesr   Úutilr   r   r   r   r$   Ú
gc_collectr(   r!   r*   r]   rc   rr   rw   rt   r¤   r®   r¹   rÃ   rÉ   rÌ   rÛ   rî   rú   r  r  r  rü   r  rÕ   r  rF  r[  rb  Úcontextmanagerrk  r'   r%   r#   Ú<module>rx     sI  ðõ #å Ý "Û Û Û 	Ý Û 	Û Û Û Û 
Ý Ý Û Û Ý å Ý Ý Ý Ý Ý #Ý Ý )Ý Ý Ý Ý "Ý Ý Ý "Ý )æòð 3Ð2€J‘ð —‘€JòòDò#ôL+òô�ô ò2ò*ò$ò(ò2+òð ñ("ó ð("òV.òbò"#ô"ò(ô ˆDô ò!ð4 ØØô5òpò#òLð, ×Ñõó ñr%   