
     h7                        d Z ddlZej                  dk  Zej                  dk\  Zej                  dk  sdej                  cxk  rdk  rn n ed      ej                  dk  Zej                  j                  d      Z	 e
ed	      Zerej                  d
k  r ed      dej                  v ZddlZ ej                   e      ZerddlZnddlZd Zg dZ e       ZereZd ZeefZefZnej4                  Zd ZefZefZeZ eZ! ed      jD                  Z#djD                  Z$erd Z%d Z&d Z'd Z(exZ)Z*d Z+d Z,d Z-nd Z%d Z&d Z'd Z(d Z)e$Z*e.Z+d Z,d  Z- ee%d!        ee&d"        ee'd#        ee(d$        ee,d%        ee-d&       ere/fZ0e/e1fZ2n	e/e3fZ0e/e3e1fZ2ere4Z5d' Z6e7Z8d( Z9d) Z:d* Z;e<Z=ne>Z5e7Z6dd+l?m8Z8m=Z= d, Z9d- Z:d. Z; ee;d/       erd0Z@nd1Z@d2 ZAd3 ZB	 dHd4ZCeCZDer ed5d6d6d78      Z eEed9      ZFn ed:d;d:d<8      Zd= ZFerd>ed?<   nd@ed?<   	 ddAlGmHZH ddDlKmLZL dE ZM G dF dGeL      ZNeNj                  ee       y# eI$ r  G dB dCeJ      ZHY 9w xY w)Iz7passlib.utils.compat - python 2/3 compatibility helpers    N)   r   )      )r   r   z?Passlib requires Python 2.6, 2.7, or >= 3.2 (as of passlib 1.7))r      javapypy_version_info)r   r   z0passlib requires pypy >= 2.0 (as of passlib 1.7)Pystonc                     || _         y)zadd docstring to an objectN)__doc__)objdocs     _/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/passlib/utils/compat/__init__.pyadd_docr   *   s	    CK    )"PY2PY3PY26BytesIOStringIONativeStringIOSafeConfigParserprint_	int_types	num_typesunicode_or_bytes_typesnative_string_typesuunicodeuascii_to_strbascii_to_strstr_to_uasciistr_to_basciijoin_unicode
join_bytesjoin_byte_valuesjoin_byte_elemsbyte_elem_valueiter_byte_valuesirangeimaplmap	iteritems
itervaluesnextOrderedDictnullcontextget_method_functionr   c                 *    t        | t              sJ | S N
isinstancestrss    r   r   r   e       !S!!r   c                 H    t        | t              sJ | j                  d      S )Nunicode_escaper5   r6   decoder7   s    r   r   r   o   s    !S!!xx())r    r   c                 *    t        | t              sJ | S r3   r5   r   r7   s    r   r   r      s    !W%%r   c                 H    t        | t              sJ | j                  d      S Nascii)r5   bytesr=   r7   s    r   r    r       s    !U##xx  r   c                 *    t        | t              sJ | S r3   r4   r7   s    r   r!   r!      r9   r   c                 H    t        | t              sJ | j                  d      S rB   )r5   r6   encoder7   s    r   r"   r"          !S!!xx  r   c                 *    t        | t              sJ | S r3   )r5   int)elems    r   r'   r'      s    $$$r   c                 *    t        | t              sJ | S r3   r5   rD   r7   s    r   r(   r(          !U##r   c                 8    t        | t              sJ d | D        S )Nc              3   4   K   | ]  }t        |g        y wr3   )rD   .0cs     r   	<genexpr>z"iter_byte_chars.<locals>.<genexpr>   s     &qqc
&s   rM   r7   s    r   iter_byte_charsrU      s    !U##&A&&r   c                 H    t        | t              sJ | j                  d      S rB   )r5   r   rG   r7   s    r   r   r      s    !W%%xx  r   c                 *    t        | t              sJ | S r3   rM   r7   s    r   r    r       rN   r   c                 H    t        | t              sJ | j                  d      S rB   r<   r7   s    r   r!   r!      rH   r   c                 *    t        | t              sJ | S r3   r4   r7   s    r   r"   r"      r9   r   c                 &    t        d | D              S )Nc              3   2   K   | ]  }t        |        y wr3   )chr)rR   vs     r   rT   z#join_byte_values.<locals>.<genexpr>   s     1Q#a&1   )r$   valuess    r   r%   r%      s    1&111r   c                 8    t        | t              sJ d | D        S )Nc              3   2   K   | ]  }t        |        y wr3   )ordrQ   s     r   rT   z#iter_byte_values.<locals>.<genexpr>   s     "1A"r^   rM   r7   s    r   r(   r(      s    !U##"""r   c                 *    t        | t              sJ | S r3   rM   r7   s    r   rU   rU      rN   r   z-helper to convert ascii unicode -> native strz+helper to convert ascii bytes -> native strz-helper to convert ascii native str -> unicodez+helper to convert ascii native str -> bytesz2iterate over byte string as sequence of ints 0-255z6iterate over byte string as sequence of 1-byte stringsc                  *    t        t        | i |      S r3   )listmap)aks     r   r+   r+      s    CKQK  r   c                 "    | j                         S r3   )itemsds    r   r,   r,      s    wwyr   c                 "    | j                         S r3   r_   rl   s    r   r-   r-      s    xxzr   c                     | j                   S r3   )__next__r   s    r   
nextgetterrr      s    ||r   )r*   izipc                 "    | j                         S r3   )r,   rl   s    r   r,   r,     s    {{}r   c                 "    | j                         S r3   )r-   rl   s    r   r-   r-     s    ||~r   c                     | j                   S r3   )r.   rq   s    r   rr   rr   
  s    xxr   z;return function that yields successive values from iterable__func__im_funcc                 $    t        | t        |       S )z4given (potential) method, return underlying function)getattrmethod_function_attrfuncs    r   r1   r1     s    4-t44r   c                 *    t         r| S | j                  S )z0given unbound method, return underlying function)r   rw   r|   s    r   get_unbound_method_functionr   "  s    4)DMM)r   c                 "    || _         d| _        | S )z
    backward compat hack to suppress exception cause in python3.3+

    one python < 3.3 support is dropped, can replace all uses with "raise exc from None"
    T)	__cause____suppress_context__)exccauses     r   
error_fromr   &  s     CM#CJr   z
io.BytesIOzio.StringIOzconfigparser.ConfigParser)r   	UnicodeIOr   r   printzcStringIO.StringIOzStringIO.StringIOzConfigParser.SafeConfigParserc                  f   |j                  dt        j                        }|j                  dd      }|j                  dd      }|rt        d      |yt	        |t
              xs$ t	        |t
              xs t        d | D              }||rt        d      nd}nt	        |t              st        d      ||rt        d	      nd	}nt	        |t              st        d
      d}|j                  }| D ]2  }|rd}n ||       t	        |t              st        |      } ||       4  ||       y)zThe new-style print function.filesepNendzinvalid keyword argumentsc              3   <   K   | ]  }t        |t                y wr3   r@   )rR   args     r   rT   zprint_.<locals>.<genexpr>X  s     D:c73Ds   
zend must be None or a string zsep must be None or a stringTF)popsysstdout	TypeErrorr5   r   anyr   r   write
basestringr6   )	argskwdsfpr   r   want_unicodefirstr   r   s	            r   r   r   I  s,    XXfcjj)hhud#hhud#788 : "#w/ E:c73K EDtDD 	 ;)!D'tCC!78:;; ;(!C&cCC!78:;;  	Cc
c:.#h#J	 	c
r   z.passlib.utils.compat._ordered_dict.OrderedDictr/   zcollections.OrderedDict)r0   c                   $    e Zd ZdZddZd Zd Zy)r0   zE
        Context manager that does no additional processing.
        Nc                     || _         y r3   enter_result)selfr   s     r   __init__znullcontext.__init__  s
     ,Dr   c                     | j                   S r3   r   )r   s    r   	__enter__znullcontext.__enter__  s    $$$r   c                      y r3    )r   exc_infos     r   __exit__znullcontext.__exit__  s    r   r3   )__name__
__module____qualname__r   r   r   r   r   r   r   r0   r0     s    		-	%	r   r0   )
ModuleTypec                 b    | j                  dd      \  }}t        ||gd      }t        ||      S )zChelper to import object from module; accept format `path.to.object`.   r   )fromlistlevel)rsplit
__import__rz   )sourcemodnamemodattrmods       r   _import_objectr     s4    }}S+GW
Wy
:C3  r   c                   :    e Zd ZdZed        ZddZd Zd Zd Z	y)	_LazyOverlayModuleag  proxy module which overlays original module,
    and lazily imports specified attributes.

    this is mainly used to prevent importing of resources
    that are only needed by certain password hashes,
    yet allow them to be imported from a single location.

    used by :mod:`passlib.utils`, :mod:`passlib.crypto`,
    and :mod:`passlib.utils.compat`.
    c                 f    t         j                  |   } | |||      }|t         j                  |<   |S r3   )r   modules)clsnameattrmaporigr   s        r   replace_modulez!_LazyOverlayModule.replace_module  s1    {{4 4$' Dr   Nc                     t        j                  | |       || _        || _        t	        j
                  |      | _        y r3   )r   r   _LazyOverlayModule__attrmap_LazyOverlayModule__proxylogging	getLogger_LazyOverlayModule__log)r   r   r   proxys       r   r   z_LazyOverlayModule.__init__  s2    D$' &&t,
r   c                 *   | j                   }|rt        ||      rt        ||      S | j                  }||v rO||   }t	        |      r |       }nt        |      }t        | ||       | j                  j                  d||       |S t        d|d      )Nzloaded lazy attr %r: %rz"'module' object has no attribute '')
r   hasattrrz   r   callabler   setattrr   debugAttributeError)r   attrr   r   r   values         r   __getattr__z_LazyOverlayModule.__getattr__  s    WUD)5$''..7?T]F&v.D$&JJ6eDLNOOr   c                 ^    | j                   }|rt        |      S t        j                  |       S r3   )r   reprr   __repr__)r   r   s     r   r   z_LazyOverlayModule.__repr__  s)    ;&&t,,r   c                    t        t        | j                              }|j                  | j                         |j                  | j
                         | j                  }||j                  t        |             t        |      S r3   )setdir	__class__update__dict__r   r   rf   )r   attrsr   s      r   __dir__z_LazyOverlayModule.__dir__  s^    C'(T]]#T^^$LLU$E{r   r3   )
r   r   r   r   classmethodr   r   r   r   r   r   r   r   r   r     s0    	  -P -r   r   r3   )Pr   r   version_infor   r   RuntimeErrorr   platform
startswithJYTHONr   PYPYr   versionPYSTONr   r   r   logbuiltins__builtin__r   __all__dict_lazy_attrsr6   r   r   rD   r   r   r   unicode_or_bytesunicode_or_strjoinr#   r$   r   r    r!   r"   r%   r&   r'   r(   rU   rc   rJ   r   floatr   longranger)   r+   rg   r*   r,   r-   rr   ziprs   xrange	itertoolsr{   r1   r   r   suppress_causerz   r   
contextlibr0   ImportErrorobjecttypesr   r   r   r   r   r   r   <module>r      sc   = 		% eu(8(8@5@
X
YY
%
 
	 	 	(s'(C!!E)
I
JJ 
S[[	 
 'g''1"'V f
 G "5\"* G* )]%- * $ uzz XX
!! */.'!!2 !OO# F G D E F G D E N O Q R
 IeIdIdE"I F!D D F D$ 
Q R %$5*
 	 
 $4	K Xw'F $%+8	K(Z !QK!:K&& !7 7t  ! !(K 8i  f s   I
 
II