
    hA                     D   S r SSKrSSKrSSKrSSKrSSKrSSK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
JrJrJrJrJr  SSKJr  SSKJr   SSKrSS	KJrJr  \R:                  S
:  a  SSKJr  OS r\ " \" 5       RB                  S   5      r\RD                  r#\$" 5       r%\RL                  " 5       r'\RP                  " 5       r)\	RT                  " 5       r+\RX                  " 5       S:H  r-Sr.\-(       a  \ " \/R`                  Rb                  5      r.\RL                  " 5       r2S r3S r4S r5S r6S r7S r8S r9S?S jr:S?S jr;S r<S r=S r>S r?\R:                  SS S:  a  \?" 5       r@\R                  S   rB\R                  S   rC\R                  S   rD\B\C\D4rE\R                  rF\R                  rG0 rH\R                  R                  5        H  u  rKrL\ " \L5      \ L d  M  \K\H\L'   M     S  rMS! rNS" rO\R:                  SS S:  a  S# rPS$ rQOSrPSrQS% rRS& rSS' rT\R                  rU\R                  rVS( rWS) rXS* rYS+ rZS, r[S- r\\\ " S. S/5      5       r]S0 r^S1 r_S2 r`\]4S3 jraS?S4 jrbS5 rcS6 rdS7 reS8 rfS9 rgS: rhS; riS@S< jrjS@S= jrkS@S> jrlg! \ a
    S=r=rr GN<f = f)AaU  
This class is defined to override standard pickle functionality

The goals of it follow:
-Serialize lambdas and nested functions to compiled byte code
-Deal with main module correctly
-Deal with other non-serializable objects

It does not include an unpickler, as standard python unpickling suffices.

This module was extracted from the `cloud` package, developed by `PiCloud, Inc.
<https://web.archive.org/web/20140626004012/http://www.picloud.com/>`_.

Copyright (c) 2012, Regents of the University of California.
Copyright (c) 2009 `PiCloud, Inc. <https://web.archive.org/web/20140626004012/http://www.picloud.com/>`_.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the University of California, Berkeley nor the
      names of its contributors may be used to endorse or promote
      products derived from this software without specific prior written
      permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    N   )pickle)OrderedDict)ClassVarGenericUnionTupleCallable)_getattribute)
_find_spec)LiteralFinal)      )CellTypec                     ^ SmU4S jn U $ )Nr   c                     > T $ N )as   W/home/james-whalen/.local/lib/python3.13/site-packages/srsly/cloudpickle/cloudpickle.pygf.<locals>.gJ   s    H    r   )r   r   s    @r   fr   G   s    	r   PyPyc                     [            [        R                  U 5      nUc1  [        R                  " 5       R
                  nU[        U '   U [        U'   S S S 5        U$ ! , (       d  f       W$ = fr   )_DYNAMIC_CLASS_TRACKER_LOCK_DYNAMIC_CLASS_TRACKER_BY_CLASSgetuuiduuid4hex_DYNAMIC_CLASS_TRACKER_BY_ID)	class_defclass_tracker_ids     r   _get_or_create_tracker_idr'   i   sc    	$:>>yI##zz|//9I+I6=F()9: 
%  
%	$ s   A
A
A*c                     U b/  [            [        R                  X5      nU [        U'   S S S 5        U$ U$ ! , (       d  f       U$ = fr   )r   r$   
setdefaultr   )r&   r%   s     r   _lookup_class_or_trackr*   s   sL    #(4?? -I9I+I6 ) 9	 )( s	   5
Ac                    [        U [        R                  5      (       d  [        S[	        U 5       S35      eU R
                  [        R                  ;  a  [        U  S35      e[        R                  U R
                  5        g)a^  Register a module to make it functions and classes picklable by value.

By default, functions and classes that are attributes of an importable
module are to be pickled by reference, that is relying on re-importing
the attribute from the module at load time.

If `register_pickle_by_value(module)` is called, all its functions and
classes are subsequently to be pickled by value, meaning that they can
be loaded in Python processes where the module is not importable.

This is especially useful when developing a module in a distributed
execution environment: restarting the client Python process with the new
source code is enough: there is no need to re-install the new version
of the module on all the worker nodes nor to restart the workers.

Note: this feature is considered experimental. See the cloudpickle
README.md file for more details and limitations.
%Input should be a module object, got  insteadzN was not imported correctly, have you used an `import` statement to access it?N)

isinstancetypes
ModuleType
ValueErrorstr__name__sysmodules_PICKLE_BY_VALUE_MODULESaddmodules    r   register_pickle_by_valuer:   |   sv    & fe..//3CK=I
 	
 ckk)h / 0
 	
   1r   c                     [        U [        R                  5      (       d  [        S[	        U 5       S35      eU R
                  [        ;  a  [        U  S35      e[        R                  U R
                  5        g)z<Unregister that the input module should be pickled by value.r,   r-   z& is not registered for pickle by valueN)r.   r/   r0   r1   r2   r3   r6   remover8   s    r   unregister_pickle_by_valuer=      sf    fe..//3CK=I
 	
 66F8#IJKK ''8r   c                  *    [         R                  5       $ r   )r6   copyr   r   r   list_registry_pickle_by_valuer@      s    #((**r   c                     U R                   nU[        ;   a  g UR                  SS5      S   nX!:X  a   gU[        ;   a  gUnM+  )NT.r   r   F)r3   r6   rsplit)r9   module_nameparent_names      r   _is_registered_pickle_by_valuerF      sW    //K..
!((a03%  22! r   c                    [         R                  SS S:  a:  [        U [        R                  5      (       a  Ub  [        [        US5      U L a  gSnO[        U SS5      nUb  U$ [         R                  R                  5       R                  5        HE  u  p#US:X  d"  Ub  [        U[        R                  5      (       d  M/   [        X15      S   U L a  Us  $ MG     g! [         a     MW  f = f)a=  Find the module an object belongs to.

This function differs from ``pickle.whichmodule`` in two ways:
- it does not mangle the cases where obj's module is __main__ and obj was
  not found in any module.
- Errors arising during module introspection are ignored, as those errors
  are considered unwanted side effects.
N   r      typing
__module____main__r   )r4   version_infor.   rK   TypeVargetattrr5   r?   itemsr/   r0   r   	Exception)objnamerD   r9   s       r   _whichmodulerU      s     f$C)H)H d ;s B
 Kc<6  #{{//1779 z)vu'7'788	V*1-4"" 5  :   		s    C
C('C(c                    [        U [        R                  5      (       d  [        [	        U 5      [        5      (       a!  [        XS9nUc  gUu  p1[        U5      (       + $ [        U [        R                  5      (       a.  [        U 5      (       a  gU R                  [        R                  ;   $ [        SR                  [	        U 5      R                  5      5      e)a  Test whether an function or a class should be pickled by reference

Pickling by reference means by that the object (typically a function or a
class) is an attribute of a module that is assumed to be importable in the
target Python environment. Loading will therefore rely on importing the
module and then calling `getattr` on it to access the function or class.

Pickling by reference is the only option to pickle functions and classes
in the standard library. In cloudpickle the alternative option is to
pickle by value (for instance for interactively or locally defined
functions and classes or for attributes of modules that have been
explicitly registered to be pickled by value.
rT   Fz*cannot check importability of {} instances)r.   r/   FunctionType
issubclasstype_lookup_module_and_qualnamerF   r0   r3   r4   r5   	TypeErrorformat)rS   rT   module_and_namer9   s       r   _should_pickle_by_referencer_      s     #u))**jcD.I.I5cE"&1&999	C))	*	* *#..||s{{**8??S	""$
 	
r   c                    Uc  [        U SS 5      nUc  [        U SS 5      n[        X5      nUc  g US:X  a  g [        R                  R	                  US 5      nUc  g  [        X15      u  pEX@La  g X14$ ! [         a     g f = f)N__qualname__r3   rM   )rP   rU   r4   r5   r    r   AttributeError)rS   rT   rD   r9   obj2parents         r   r[   r[     s    |sND1| sJ-s)K j  [[__[$/F~ $V2 <  s   A1 1
A>=A>c                 F   [         R                  U 5      nUc  [        U 5       Vs0 s H  o"S_M     nnU R                  (       aN  U R                   H>  n[	        U[
        R                  5      (       d  M$  UR                  [        U5      5        M@     U[         U '   U$ s  snf )z;
Find all globals names read or written to by codeblock co
N)	_extract_code_globals_cacher    _walk_global_ops	co_constsr.   r/   CodeTypeupdate_extract_code_globals)co	out_namesrT   consts       r   rk   rk   >  s     ,//3I -=R,@A,@D4Z,@	A <<eU^^44$$%:5%AB & +4#B' Bs   Bc                    / nU H  n[        U[        R                  5      (       d  M$  [        US5      (       d  M7  UR                  (       d  MJ  UR
                  S-   n[        [        R                  5       H  nUc  M  UR                  U5      (       d  M   [        U[        U5      S R                  S5      5      nU[        U R                  5      -
  (       a  Me  UR                  [        R                  U   5        M     M     U$ )a  
Find currently imported submodules used by a function.

Submodules used by a function need to be detected and referenced for the
function to work correctly at depickling time. Because submodules can be
referenced as attribute of their parent package (``package.submodule``), we
need a special introspection technique that does not rely on GLOBAL-related
opcodes to find references of them in a code object.

Example:
```
import concurrent.futures
import cloudpickle
def func():
    x = concurrent.futures.ThreadPoolExecutor
if __name__ == '__main__':
    cloudpickle.dumps(func)
```
The globals extracted by cloudpickle in the function's state include the
concurrent package, but not its submodule (here, concurrent.futures), which
is the module used by func. Find_imported_submodules will detect the usage
of concurrent.futures. Saving this module alongside with func will ensure
that calling func once depickled does not fail due to concurrent.futures
not being imported
__package__rB   N)r.   r/   r0   hasattrrp   r3   listr4   r5   
startswithsetlensplitco_namesappend)codetop_level_dependencies
subimportsxprefixrT   tokenss          r   _find_imported_submodulesr   Y  s    6 J#q%**++=))ammmZZ#%F S[[) #(?(? c&kl!3!9!9#!>?F!C$666"))#++d*;< * $ r   c                     [         R                  SS S:  a  Xl        g[        R                  " [
        0 SSU 45      nU" U5        g)a	  Set the value of a closure cell.

The point of this function is to set the cell_contents attribute of a cell
after its creation. This operation is necessary in case the cell contains a
reference to the function the cell belongs to, as when calling the
function's constructor
``f = types.FunctionType(code, globals, name, argdefs, closure)``,
closure will not be able to contain the yet-to-be-created f.

In Python3.7, cell_contents is writeable, so setting the contents of a cell
can be done simply using
>>> cell.cell_contents = value

In earlier Python3 versions, the cell_contents attribute of a cell is read
only, but this limitation can be worked around by leveraging the Python 3
``nonlocal`` keyword.

In Python2 however, this attribute is read only, and there is no
``nonlocal`` keyword. For this reason, we need to come up with more
complicated hacks to set this attribute.

The chosen approach is to create a function with a STORE_DEREF opcode,
which sets the content of a closure variable. Typically:

>>> def inner(value):
...     lambda: cell  # the lambda makes cell a closure
...     cell = value  # cell is a closure, so this triggers a STORE_DEREF

(Note that in Python2, A STORE_DEREF can never be triggered from an inner
function. The function g for example here
>>> def f(var):
...     def g():
...         var += 1
...     return g

will not modify the closure variable ``var```inplace, but instead try to
load a local variable var and increment it. As g does not assign the local
variable ``var`` any initial value, calling f(1)() will fail at runtime.)

Our objective is to set the value of a given cell ``cell``. So we need to
somewhat reference our ``cell`` object into the ``inner`` function so that
this object (and not the smoke cell of the lambda function) gets affected
by the STORE_DEREF operation.

In inner, ``cell`` is referenced as a cell variable (an enclosing variable
that is referenced by the inner function). If we create a new function
cell_set with the exact same code as ``inner``, but with ``cell`` marked as
a free variable instead, the STORE_DEREF will be applied on its closure -
``cell``, which we can specify explicitly during construction! The new
cell_set variable thus actually sets the contents of a specified cell!

Note: we do not make use of the ``nonlocal`` keyword to set the contents of
a cell in early python3 versions to limit possible syntax errors in case
test and checker libraries decide to parse the whole file.
NrH   rI   	_cell_setr   )r4   rN   cell_contentsr/   rX   _cell_set_template_code)cellvaluer   s      r   cell_setr     sF    r v%"&&#Rb4'D	%r   c                     S n U R                   n[        R                  " UR                  UR                  UR
                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  UR                   S5      nU$ )Nc                    ^ U4S j  U mg )Nc                     > T $ r   r   r   s   r   <lambda>I_make_cell_set_template_code.<locals>._cell_set_factory.<locals>.<lambda>  s    r   r   r   r   s    @r   _cell_set_factory7_make_cell_set_template_code.<locals>._cell_set_factory  s    r   r   )__code__r/   ri   co_argcountco_kwonlyargcount
co_nlocalsco_stacksizeco_flagsco_coderh   rw   co_varnamesco_filenameco_nameco_firstlineno	co_lnotabco_cellvars)r   rl   r   s      r   _make_cell_set_template_coder     s     
	#	#B#nn


















" #"r   rH   rI   STORE_GLOBALDELETE_GLOBALLOAD_GLOBALc                 :    U S:X  a  [         $ [        [        U 5      $ )N	ClassType)rZ   rP   r/   rW   s    r   _builtin_typer     s    { 5$r   c              #      #    [         R                  " U 5       H)  nUR                  nU[        ;   d  M  UR                  v   M+     g7f)zJ
Yield referenced name for all global-referencing instructions in *code*.
N)disget_instructionsopcode
GLOBAL_OPSargval)ry   instrops      r   rg   rg     s7      %%d+\\,, ,s
   .AAc                    [        U R                  5      n[        U R                  5      S:X  a  U R                  S   R                  nO90 n[	        U R                  5       H  nUR                  UR                  5        M      / nUR                  5        H!  u  pV X%   nXgL a  UR                  U5        M!  M#     U H  nUR                  U5        M     U$ ! [         a     MN  f = f)zDRetrieve a copy of the dict of a class without the inherited methodsr   r   )
dict__dict__ru   	__bases__reversedrj   rQ   rx   KeyErrorpop)clsclsdictinherited_dictbase	to_removerT   r   
base_values           r   _extract_class_dictr   	  s    3<< G
3==Qq)22S]]+D!!$--0 ,I}}	'-J"  & # ' D N	  		s   C
C#"C#c           	         [        [        U 5      SS 5      nUS:H  nUS:H  n[        U SS 5      S Ln[        U SS 5      S L=(       a    Un[        U SS 5      S L=(       a    Un[        U SS 5      S L=(       a    Un[        U SS 5      S Ln[        U SS 5      S Ln	[        U S	S 5      S L=(       a    [        U S
S 5      S Ln
[        XEXgUX45      $ )NrL   typing_extensionsrK   
__origin__
__values____type____union_params____tuple_params__
__result____args__)rP   rZ   any)rS   type_modulefrom_typing_extensionsfrom_typing	is_typing
is_literalis_finalis_classvaris_unionis_tupleis_callables              r   _is_parametrized_type_hintr      s    d3it<!,0C!C!X- Ct4D@	 S,-T9 '& 	 S*d+47 '& 	 S*d+47H[ 	
 3 2D9E3 2D9ECt,D8 7CT*$6 	 I8(+ , 	,r   c                 
    X   $ r   r   )originargss     r   _create_parametrized_type_hintr   E  s
    |r   c                 H   [        U 5      [        [        5      L a  [        U R                  4nU$ [        U 5      [        [        5      L a  [        U R                  4nU$ [        U 5      [        [
        5      L a  [
        U R                  4nU$ [        U 5      [        [        5      L a  U R                  U R                  4nU$ [        U 5      [        [        5      L a  [        U R                  4nU$ [        U 5      [        [        5      L a  [        U R                  4nU$ [        U 5      [        [        5      L aF  U R                  Gt p#[        U5      S:X  a  US   [        L a  [        nO[        U5      n[        X#44nU$ [        R                   " S[        U 5       35      e)Nr   r   z Cloudpickle Error: Unknown type )rZ   r   r   r   r   r   r   r   r   r   r	   r
   ru   Ellipsisrr   r   PicklingError)rS   initargsr   results       r   "parametrized_type_hint_getinitargsr   L  sg    CyDM!S^^,, O+ 
cd5k	!3<<(( O' 
cd8n	$cll+$ O# 
cd7m	#NNCLL1  O 
cd5k	!3<<( O 
cd5k	!3<<( O 
cd8n	$,,$t9>d1g1D:Dtn-
 O "".tCyk:
 	
r   c                     S[         R                  ;  a  g[         R                  S   n[        US5      (       d  gUR                  U 5      $ )z^
Return whether *func* is a Tornado coroutine function.
Running coroutines are not supported.
ztornado.genFis_coroutine_function)r4   r5   rq   r   funcgens     r   is_tornado_coroutiner   l  sC    
 CKK'
++m
$C3/00$$T**r   c                 0    SSK Jn  UR                  U 5      $ )Nr   )r   )tornador   	coroutiner   s     r   _rebuild_tornado_coroutiner   z  s    ==r   c                 >    [        U 5        [        R                  U    $ r   )
__import__r4   r5   rW   s    r   	subimportr     s    
 t;;tr   c                     [         R                  " U 5      nUR                  R                  U5        [        R                  UR                  S'   U$ N__builtins__)r/   r0   r   rj   builtins)rT   varsmods      r   dynamic_subimportr     s=    


4
 CLL#+#4#4CLL Jr   c                      [         $ r   )r   r   r   r   _gen_ellipsisr     s    Or   c                      [         $ r   )NotImplementedr   r   r   _gen_not_implementedr     s    r   c                 H     U R                   $ ! [         a	    [        s $ f = fr   )r   r1   _empty_cell_valuer   s    r   _get_cell_contentsr     s(    !!!! !  !s    !!c                     U " 5       $ )zCreate a new instance of a class.

Parameters
----------
cls : type
    The class to create an instance of.

Returns
-------
instance : cls
    A new instance of ``cls``.
r   r   s    r   instancer     s     5Lr   c                   (    \ rS rSrSr\S 5       rSrg)r   i  z sentinel for empty closures
    c                     U R                   $ r   )r3   r   s    r   
__reduce___empty_cell_value.__reduce__  s    ||r   r   N)r3   rL   ra   __firstlineno____doc__classmethodr   __static_attributes__r   r   r   r   r     s     r   r   c                     [        U 5      S:X  a  U S   nU S   nOo[        U 5      S:X  a!  U S   n/ SQn[        [        X0SS 5      5      nO?[        U 5      S:X  a!  U S   n/ SQn[        [        X0SS 5      5      nO[        S	U < 35      eUR                  R                  US
   5        US   Ul        US   Ul        SU;   a
  US   Ul        SU;   a
  US   Ul	        SU;   a
  US   Ul
        SU;   a
  US   Ul        SU;   a
  US   Ul        SU;   a
  US   Ul        SU;   a  UR                  S5        UR                  nUb-  [        XBS   5       H  u  pVU[         Ld  M  [#        XV5        M     U$ )zzFills in the rest of function data into the skeleton function object

The skeleton itself is create by _make_skel_func().
rH   r   r      )globalsdefaultsr   closure_valuesN   )r  r  r   r9   r  z"Unexpected _fill_value arguments: r  r  r   annotationsdocrT   r9   qualname
kwdefaults_cloudpickle_submodulesr  )ru   r   zipr1   __globals__rj   __defaults__r   __annotations__r   r3   rL   ra   __kwdefaults__r   __closure__r   r   )r   r   statekeyscellsr   r   s          r   _fill_functionr    s   
 4yA~AwQ	Ta Aw@SABx()	Ta AwJSABx()=dXFGG 	E),-j)D&MDM$]3~U|f5/U!*-u#L1 !E)		+,Eu,<&=>KD--% ? Kr   c                 D    [         US'   [        R                  " XX#U5      $ r   )r   r/   rX   )ry   r  rT   argdefsclosures        r   _make_functionr    s!    *GNdTGDDr   c                  ,   ^   U 4S jR                  S   $ )Nc                     > T $ r   r   r   s   r   r   "_make_empty_cell.<locals>.<lambda>
  s    Dr   r   )AssertionErrorr  r   s   @r   _make_empty_cellr    s    
 %%a((r   c                 B    [        5       nU [        La  [        X5        U$ r   )r  r   r   r   s     r   
_make_cellr    s     D%%Kr   c                     [         R                  " S[        S9  Ub  [        U[        5      (       a  0 n[
        US'   US:  a  [        S [        U5       5       5      OSn[        R                  " XSSU5      $ )zCreates a skeleton function object that contains just the provided
code and the correct number of cells in func_closure.  All other
func attributes (e.g. func_globals) are empty.
zA pickle file created using an old (<=1.4.1) version of cloudpickle is currently being loaded. This is not supported by cloudpickle and will break in cloudpickle 1.7)categoryNr   r   c              3   6   #    U  H  n[        5       v   M     g 7fr   )r  ).0_s     r   	<genexpr>"_make_skel_func.<locals>.<genexpr>(  s     <*;Q  *;s   )
warningswarnUserWarningr.   r2   r   tupleranger/   rX   )ry   
cell_countbase_globalsr  s       r   _make_skel_funcr.    sz     MM	(2= z,<<#/L  ? 	<%
*;<< 
 d$gFFr   c                 V   ^ [         R                  " XSU 0U4S j5      n[        XF5      $ )a  Build dynamic class with an empty __dict__ to be filled once memoized

If class_tracker_id is not None, try to lookup an existing class definition
matching that id. If none is found, track a newly reconstructed class
definition under that id so that other instances stemming from the same
class id will also reuse this class definition.

The "extra" variable is meant to be a dict (or None) that can be used for
forward compatibility shall the need arise.
	metaclassc                 &   > U R                  T5      $ r   )rj   )nstype_kwargss    r   r   &_make_skeleton_class.<locals>.<lambda>=  s    299[)r   )r/   	new_classr*   )type_constructorrT   basesr3  r&   extraskeleton_classs      `   r   _make_skeleton_classr:  /  s/     __k#34)N ""2CCr   c                     SnUR                  5        H  u  p4US:X  a  UnM  [        XU5        M     Ub  U H  nU R                  U5        M     U $ )zoPut attributes from `class_dict` back on `skeleton_class`.

See CloudPickler.save_dynamic_class for more info.
N	_abc_impl)rQ   setattrregister)r9  
class_dictregistryattrnameattrsubclasss         r   _rehydrate_skeleton_classrD  B  s]    
 H$**,{"HNd3	 -
  H##H- ! r   c                     U S   nUR                   nUR                  X5      n	UR                  5        H	  u  pXU
'   M     UR                  XX	5      nXLl        X,l        [        X\5      $ )a  Build dynamic enum with an empty __dict__ to be filled once memoized

The creation of the enum class is inspired by the code of
EnumMeta._create_.

If class_tracker_id is not None, try to lookup an existing enum definition
matching that id. If none is found, track a newly reconstructed enum
definition under that id so that other instances stemming from the same
class id will also reuse this enum definition.

The "extra" variable is meant to be a dict (or None) that can be used for
forward compatibility shall the need arise.
)	__class____prepare__rQ   __new__rL   ra   r*   )r7  rT   r  membersr9   r&   r8  	enum_basemetacls	classdictmember_namemember_value
enum_classs                r   _make_skeleton_enumrQ  T  sk    " b	I!!G##D0I%,]]_!!-+ &5AJ"&!"2??r   c                 X    [         R                  " U /UQ7UX4S.6nUb  [        XV5      $ U$ )N)bound	covariantcontravariant)rK   rO   r*   )rT   rS  constraintsrT  rU  r&   tvs          r   _make_typevarrX  r  sA    	

"'
B #%&6;; 	r   c                     U R                   U R                  U R                  U R                  U R                  [        U 5      4$ r   )r3   	__bound____constraints____covariant____contravariant__r'   )rS   s    r   _decompose_typevarr^    s:    cmmS%8%8300!#& r   c                     [        X R                  S9nUc  [        [        U 5      4$ [	        US   5      (       a  [        [        U 5      4$ [
        U4$ )NrW   r   )r[   r3   rX  r^  rF   rP   )rS   r^   s     r   _typevar_reducer`    sU     2#LLIO1#677	'(:	;	;1#677_%%r   c                 D    S[        U S0 5      ;   a  SnOSn[        X5      $ )N__orig_bases__r   r   )rP   )typ
bases_attrs     r   
_get_basesre    s,    73
B77 &
 !
3##r   c                     U(       a$  [         R                  " U 5      R                  5       $ [        R                  U 5      R                  5       $ r   )r   fromkeysr  r   rS   
is_ordereds     r   _make_dict_keysrj    s7    ##C(--//}}S!&&((r   c                     U(       a)  [        S [        U 5       5       5      R                  5       $ [        U 5       VVs0 s H  u  p#X#_M	     snnR                  5       $ s  snnf )Nc              3   ,   #    U  H
  u  pX4v   M     g 7fr   r   )r#  ir$  s      r   r%  $_make_dict_values.<locals>.<genexpr>  s     =ndaA6ns   )r   	enumeratevalues)rS   ri  rm  r$  s       r   _make_dict_valuesrq    sL    =in==DDFF!*30077990s   Ac                 b    U(       a  [        U 5      R                  5       $ U R                  5       $ r   )r   rQ   rh  s     r   _make_dict_itemsrs    s%    3%%''yy{r   r   )F)mr   r   r   r   platformr4   r/   weakrefr!   	threadingrK   r'  compatr   collectionsr   r   r   r   r	   r
   r   importlib._bootstrapr   r   _typing_extensionsr   r   ImportErrorrN   r   r   rZ   r  HIGHEST_PROTOCOLDEFAULT_PROTOCOLrt   r6   WeakKeyDictionaryr   WeakValueDictionaryr$   Lockr   python_implementationPYPYbuiltin_code_typefloatrI  r   rf   r'   r*   r:   r=   r@   rF   rU   r_   r[   rk   r   r   r   r   opmapr   r   r   r   HAVE_ARGUMENTEXTENDED_ARG_BUILTIN_TYPE_NAMESr   rQ   kvr   rg   r   r   r   r   r   r   loadloadsr   r   r   r   r   r   r   r  r  r  r  r.  r:  rD  rQ  rX  r^  r`  re  rj  rq  rs  r   r   r   <module>r     s  )V  
   
        # < <   +020 v ACOOA&'H **  5 
 #*";";"= &::< 'nn. %%'61 U]]334%779 &2R	9++\"
J%P6,^>B#6 BQ& :< ||N+_-ll=)M;7
!!  NN  "DAqAw$!"A #
 , BQ& #,J "&%)"@+ {{!  
  
>BE) ' G6D&$@<

&$):_  0+///50s   J JJ