ÿØÿà JFIF    ÿÛ „  ( %"1!%)+...383,7(-.+  -+++--++++---+-+-----+---------------+---+-++7-----ÿÀ  ß â" ÿÄ     ÿÄ H    !1AQaq"‘¡2B±ÁÑð#R“Ò Tbr‚²á3csƒ’ÂñDS¢³$CÿÄ   ÿÄ %  !1AQa"23‘ÿÚ   ? ôÿ ¨pŸªáÿ —åYõõ\?àÒü©ŠÄï¨pŸªáÿ —åYõõ\?àÓü©ŠÄá 0Ÿªáÿ Ÿå[úƒ ú®ði~TÁbqÐ8OÕpÿ ƒOò¤Oè`–RÂáœá™êi€ßÉ< FtŸI“öÌ8úDf´°å}“¾œ6  öFá°y¥jñÇh†ˆ¢ã/ÃÐ:ªcÈ "Y¡ðÑl>ÿ ”ÏËte:qž\oäŠe÷󲍷˜HT4&ÿ ÓÐü6ö®¿øþßèô Ÿ•7Ñi’•j|“ñì>b…þS?*Óôÿ ÓÐü*h¥£ír¶ü UãS炟[AÐaè[ûª•õ&õj?†Éö+EzP—WeÒírJFt ‘BŒ†Ï‡%#tE Øz ¥OÛ«!1›üä±Í™%ºÍãö]°î(–:@<‹ŒÊö×òÆt¦ãº+‡¦%ÌÁ²h´OƒJŒtMÜ>ÀÜÊw3Y´•牋4ǍýʏTì>œú=Íwhyë,¾Ôò×õ¿ßÊa»«þˆѪQ|%6ž™A õ%:øj<>É—ÿ Å_ˆCbõ¥š±ý¯Ýƒï…¶|RëócÍf溪“t.СøTÿ *Ä¿-{†çàczůŽ_–^XþŒ±miB[X±d 1,é”zEù»& î9gœf™9Ð'.;—™i}!ôšåîqêÛ٤ёý£½ÆA–àôe"A$˝Úsäÿ ÷Û #°xŸëí(l »ý3—¥5m! rt`†0~'j2(]S¦¦kv,ÚÇ l¦øJA£Šƒ J3E8ÙiŽ:cÉžúeZ°€¯\®kÖ(79«Ž:¯X”¾³Š&¡* ….‰Ž(ÜíŸ2¥ª‡×Hi²TF¤ò[¨íÈRëÉ䢍mgÑ.Ÿ<öäS0í„ǹÁU´f#Vß;Õ–…P@3ío<ä-±»Ž.L|kªÀê›fÂ6@»eu‚|ÓaÞÆŸ…¨ááå>åŠ?cKü6ùTÍÆ”†sĤÚ;H2RÚ†õ\Ö·Ÿn'¾ ñ#ºI¤Å´%çÁ­‚â7›‹qT3Iï¨ÖÚ5I7Ë!ÅOóŸ¶øÝñØôת¦$Tcö‘[«Ö³šÒ';Aþ ¸èíg A2Z"i¸vdÄ÷.iõ®§)¿]¤À†–‡É&ä{V¶iŽ”.Ó×Õÿ û?h¬Mt–íª[ÿ Ñÿ ÌV(í}=ibÔ¡›¥¢±b Lô¥‡piη_Z<‡z§èŒ)iÖwiÇ 2hÙ3·=’d÷8éŽ1¦¸c¤µ€7›7Ø ð\á)} ¹fËí›pAÃL%âc2 í§æQz¿;T8sæ°qø)QFMð‰XŒÂ±N¢aF¨…8¯!U  Z©RÊ ÖPVÄÀÍin™Ì-GˆªÅËŠ›•zË}º±ŽÍFò¹}Uw×#ä5B¤{î}Ð<ÙD é©¤&‡ïDbàÁôMÁ." ¤‡ú*õ'VŽ|¼´Úgllº¼klz[Æüï÷Aób‡Eÿ dÑ»Xx9ÃÜ£ÁT/`¼¸vI±Ýµ·Ë‚“G³þ*Ÿû´r|*}<¨îºœ @¦mÄ’M¹”.œ«Y–|6ÏU¤jç¥ÕÞqO ˜kDÆÁ¨5ÿ š;ÐЦ¦€GÙk \ –Þ=â¼=SͧµªS°ÚÍpÜãQűÀõ¬?ÃÁ1Ñ•õZà?hóœ€ L¦l{Y*K˜Ù›zc˜–ˆâ ø+¾ ­-Ök¥%ùEÜA'}ˆ><ÊIè“bpÍ/qÞâvoX€w,\úªò6Z[XdÒæ­@Ö—€$òJí#é>'°Ú ôª˜<)4ryÙ£|óAÅn5žêŸyÒäMÝ2{"}‰–¤l÷ûWX\l¾Á¸góÉOÔ /óñB¤f¸çñ[.P˜ZsÊË*ßT܈§QN¢’¡¨§V¼(Üù*eÕ“”5T¨‹Âê¥FŒã½Dü[8'Ò¥a…Ú¶k7a *•›¼'Ò·\8¨ª\@\õ¢¦íq+DÙrmÎ…_ªæ»ŠÓœ¡¯’Ré9MÅ×D™lælffc+ŒÑ,ý™ÿ ¯þǤ=Å’Á7µ÷ÚÛ/“Ü€ñýã¼àí¾ÕÑ+ƒ,uµMâÀÄbm:ÒÎPæ{˜Gz[ƒ¯«® KHà`ߨŠéí¯P8Aq.C‰ à€kòpj´kN¶qô€…Õ,ÜNŠª-­{Zö’æû44‰sŽè‰îVíRœÕm" 6?³D9¡ÇTíÅꋇ`4«¸ÝÁô ï’ýorqКÇZ«x4Žâéþuïf¹µö[P ,Q£éaX±`PÉÍZ ¸äYúg üAx ’6Lê‚xÝÓ*äQ  Ï’¨hÍ =²,6ï#rÃ<¯–£»ƒ‹,–ê•€ aÛsñ'%Æ"®ÛüìBᝠHÚ3ß°©$“XnœÖ’î2ËTeûìxîß ¦å¿çÉ ðK§þ{‘t‚Ϋ¬jéîZ[ ”š7L¥4VÚCE×]m¤Øy”ä4-dz£œ§¸x.*ãÊÊ b÷•h:©‡¦s`BTÁRû¾g⻩‹jø sF¢àJøFl‘È•Xᓁà~*j¯ +(ÚÕ6-£¯÷GŠØy‚<Ç’.F‹Hœw(+)ÜÜâÈzÄäT§FߘãÏ;DmVœ3Àu@mÚüXÝü•3B¨òÌÁÛ<·ÃÜ z,Ì@õÅ·d2]ü8s÷IôÞ¯^Ç9¢u„~ëAŸï4«M? K]­ÅàPl@s_ p:°¬ZR”´›JC[CS.h‹ƒïËœ«Æ]–÷ó‚wR×k7X‰k›‘´ù¦=¡«‰¨¨Â')—71ó’c‡Ðúµ `é.{§p¹ój\Ž{1h{o±Ý=áUÊïGÖŒõ–-BÄm+AZX¶¡ ïHðæ¥JmÙ;…䡟ˆ¦ ° äšiÉg«$üMk5¤L“’çÊvïâï ,=f“"íἊ5ô¬x6{ɏžID0e¸vçmi'︧ºð9$ò¹÷*£’9ÿ ²TÔ…×>JV¥}Œ}$p[bÔ®*[jzS*8 ”·T›Í–ñUîƒwo$áè=LT™ç—~ô·¤ÈÚ$榍q‰„+´kFm)ž‹©i–ËqÞŠ‰à¶ü( ‚•§ •°ò·‡#5ª•µÊ﯅¡X¨šÁ*F#TXJÊ ušJVÍ&=iÄs1‚3•'fý§5Ñ<=[íÞ­ PÚ;ѱÌ_~Ä££8rÞ ²w;’hDT°>ÈG¬8Á²ÚzŽ®ò®qZcqJêäÞ-ö[ܘbň±çb“ж31²n×iƒðÕ;1¶þÉ ªX‰,ßqÏ$>•î íZ¥Z 1{ç൵+ƒÕµ¥°T$§K]á»Ûï*·¤tMI’ÂZbŽÕiÒ˜}bÓ0£ª5›¨ [5Ž^ÝœWøÂÝh° ¢OWun£¤5 a2Z.G2³YL]jåtì”ä ÁÓ‘%"©<Ôúʰsº UZvä‡ÄiÆÒM .÷V·™ø#kèýiíÌ–ª)µT[)BˆõÑ xB¾B€ÖT¨.¥~ð@VĶr#¸ü*åZNDŽH;âi ],©£öØpù(šºãö¼T.uCê•4@ÿ GÕÛ)Cx›®0ø#:ÏðFÒbR\(€€Ä®fã4Þ‰Fä¯HXƒÅ,†öEÑÔÜ]Öv²?tLÃvBY£ú6Êu5ÅAQ³1‘’¬x–HŒÐ‡ ^ ¸KwJôÖŽ5×CÚ¨vÜ«/B0$×k°=ðbÇ(Ï)w±A†Á† 11Í=èQšµ626ŒÜ/`G«µ<}—-Ö7KEHÈÉðóȤmݱû±·ø«Snmá=“䫚mݱŸ¡¶~ó·“äUóJæúòB|E LêŽy´jDÔ$G¢þÐñ7óR8ýÒ…Ç› WVe#·Ÿ p·Fx~•ݤF÷0Èÿ K¯æS<6’¡WШ; ´ÿ ¥Êø\Òuî†åÝ–VNœkÒ7oòX¨Á­Ø÷FÎÑä±g÷ÿ M~Çî=p,X´ ÝÌÚÅ‹’ÃjÖ.ØöÏñ qïQ¤ÓZE†° =6·]܈ s¸>v•Ž^Ý\wq9r‰Î\¸¡kURÒ$­*‹Nq?Þª*!sŠÆ:TU_u±T+øX¡ ®¹¡,ÄâÃBTsÜ$Ø›4m椴zÜK]’’›Pƒ @€#â˜`é¹=I‡fiV•Ôî“nRm+µFPOhÍ0B£ €+¬5c v•:P'ÒyÎ ‰V~‚Ó†ÖuókDoh$å\*ö%Ю=£«…aȼ½÷Û.-½VŒŠ¼'lyî±1¬3ó#ÞE¿ÔS¤gV£m›=§\û"—WU¤ÚǼÿ ÂnÁGŒÃ ‚õN D³õNÚíŒÕ;HôyÄÈ©P¹Ä{:?R‘Ô¨âF÷ø£bÅó® JS|‚R÷ivýáâ€Æé¡è³´IئÑT!§˜•ت‚¬â@q€wnïCWÄ@JU€ê¯m6]Ï:£âx'+ÒðXvÓ¦Úm=–´7œ $ì“B£~p%ÕŸUþ« N@¼üï~w˜ñø5®—'Ôe»¤5ã//€ž~‰Tþ›Å7•#¤× Íö pÄ$ùeåì*«ÓŠEØWEÈsßg ¦ûvžSsLpºÊW–âµEWöˬH; ™!CYõZ ÃÄf æ#1W. \uWâ\,\Çf j’<qTbên›Î[vxx£ë 'ö¨1›˜ÀM¼Pÿ H)ƒêêŒA7s,|F“ 꺸k³9Ìö*ç®;Ö!Ö$Eiž•¹ÒÚ†ýóéÝû¾ÕS®ó$’NÝäŸz¤5r¦ãÄÃD÷Üø!°ø‡Ô&@m™Ì^Ãä­d q5Lnÿ N;.6½·N|#ä"1Nƒx“ã<3('&ñßt  ~ªu”1Tb㫨9ê–›–bìd$ߣ=#ÕãÒmU¯eí$EFù5ýYô櫨æì™Ç—±ssM]·á¿0ÕåJRÓªîiƒ+O58ÖñªŠÒx" \µâá¨i’¤i —Ö ” M+M¤ë9‚‰A¦°Qõ¾ßøK~¼Ã‘g…Ö´~÷Ï[3GUœÒ½#…kàÔ®Ò”‰³·dWV‰IP‰Ú8u¹”E ÖqLj¾êÕCBš{A^Âß;–¨`¯¬ìö ˼ ×tìø.tƐm*n¨y4o&Àx¥n¦×î‡aupáÛj8¿m›è¶ã!o½;ß0y^ý×^EÑ¿ÒjzŒ­)vÚÑnÄL …^ªô× ‡—‚3k Îý­hï]içå–îÏ*÷ñþ»Ô CÒjøjÍznˆ´ ¹#b'Fô‹ ‰v¥'’à'T´ƒHýÍ%M‰ ƒ&ÆÇŒï1 ‘ –Þ ‰i¬s žR-Ÿ kЬá¬7:þ 0ŒÅÒÕ/aÙ¬ÃÝ#Úøœ ©aiVc‰. ¹¦ãµ” ›Yg¦›ÆÎýº°f³7ƒhá·¸­}&D9¡ÂsÉÙÞèŠõØàC™¨ñbFC|´Ü(ŸƒÚÒ-%»'a Ì¿)ËÇn¿úÿ ÞŽX…4ÊÅH^ôΑí@ù¹Eh¶“L8Çjù ¼ÎåVªóR©Ï5uà V4lZß®=€xÖŸ–ÑÈ ÷”¨°¾__yM1tÉ?uÆþIkÄgæ@þ[¢†°XÃJ£j·:nkÅ¢u ‘}âGzö­/IµèЬ¼48q¦F°ŽR¼=ûì{´¯RýicS ÕÛ íNtÍÙï£,w4rêì®»~x(©Uñ§#Ñ&œÕ¤>ÎåÍÓ9’Ö{9eV­[Öjâ²ãu]˜å2›qÑšÕJç0€sÄ|Êëè0튔bÁ>“{×_F`Ø©ºê:µä,v¤ðfc1±"«ÔÍän1#=· Âøv~H½ÐßA¾¿Ü€Óš]Õ; I¾÷ç‚Qi†î¹9ywÔKG˜áñ zQY—§ÃÕZ07§X‚ Áh;ÁM)iÌCH-¯T‘ë|A0{Ò½LÚ–TâÖkÜ’dÀ“rmm»”جPF³ÖcbE§T€ÒxKºû’Ó®7±²(\4ŽÃ¸Uu@j™yĵ;³µ!Á¢b.W¤=mõ´êµK k ¸K^ÜÛ#p*Ü14qkZç5ïë †°5Ï%ÍÛ<Õ¤×Ô¥ê†C Õ´¼ú$ƒÖ“”]Ù¬qÞÚ[4©ý!ûÏ—Áb쳐XµA¬â~`›Çr¸8ìùÝ䫦<>ä÷«?xs´ÇÑ /á;¹øüÊÈÙà{"@Žïzâ¬[âß‚ U_<ÇŸ½4èN˜ú61®qŠu ¦þF£»äJ_ˆÙÎ~ ÞAã–݄ϗrŠD;xTž‘ô`É«…suãO`?³à™ô Lý#Íc5öoæØ‚y´´÷«ZR§<&JÇ+éâô´€i!Àˆ0æAoàðLèÖ-2ŸõW.’t^–(KÁmHµV@xÜÇy®Ñø­â^:Ú3w· 7½¹°ñ¸â¹®:',«Mœ—n­Á+Ãbš LÈ‘ÄnRÓÅœ%¦²‰¨ùQ:¤f‚ "PÕtô¸…cæl…&˜Ú˜Ôkv‹ž+vŠ,=¢v­6—Xy*¥t£«<™:“aîϲ=¦6rO]XI¿Œ÷¤zÚ­›¶ 6÷”w\d ü~v®ˆÌk«^m<ÿ ¢‰Õ\)ùºŽ;… lîÙÅEŠ®cѾ@vnMÏ,¼“ñ•ŽBxðÃzãÇç%3ˆ"}Ù•Åî> BÉú;Ò]V+P˜F_´ßé> Øše|ï‡ÄOmFæÇ ãqÞ$/xÐx­z`ï9"œÜij‚!7.\Td…9M‡•iŽ‹¾‘50ÞŽn¥ß4ÉôO ¹*í^QêËÜÇÌ8=ާs‰'ÂëÙ«á%Pú[O †ÅP¯Vsް.‰,kc¶ ¬A9n˜XÎ-ÞšN["¹QÕ‰ƒMýÁߺXJæÍaLj¾×Ãmã¾ãÚ uñÒþåQô¦¥ /ÄUx:‚ÍÜ’ Đ©ØÝ3V¨‰ÕnÐ6ó*óúK­«…c ¯U òhsý­jóÔj#,ímŒRµ«lbïUTŒÑ8†Ä0œÏr`ð¡¬É Ї ë"À² ™ 6¥ f¶ ¢ÚoܱԷ-<Àî)†a¶ž'Ú»¨TXqØæ¶÷YÄHy˜9ÈIW­YÀuMFë ºÏ’AqÌ4·/Ú †ô'i$øä­=Ä Ý|öK×40è|È6p‘0§)o¥ctî§H+CA-“ xØ|ÐXАç l8íºð3Ø:³¤¬KX¯UÿÙ U ]]@sddlmZmZmZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ddlmZmZmZmZmZmZddlmZmZmZmZmZejZdZd Zd Z d Z!d Z"eiZ#eZ$Gd ddeZ%e%Z&e&ddddddddddddf ddZ'ddZ(e(ddddgZ)ddZ*ddZ+ddZ,dd Z-d!d"Z.d#d$Z/Gd%d&d&eZ0d'Z1d(d)Z2dbd*dZ3e3Z4er|d+d,Z5nd-d,Z5d.d/Z6d0d1Z7d2d3Z8d4d5Z9d6d7Z:d8d9Z;d:d;ZZ?d>d?Z@ddd@dAZAdBdCZBdDdEZCdFdGZDdHdIZEdJdKZFdLdMZGdNdOZHGdPdQdQeZIdRdSeIjJDZKe9e=eAeIeKdTeKdTdUdSeKDdTZIGdVdWdWeZLe=eAeLZLe3ddddXGdYdZdZeZMeffd[d\ZNe3ddd]Gd^d_d_eZOd`daZPdS)e)absolute_importdivisionprint_functionN) itemgetter)_config)PY2isclass iteritemsmetadata_proxy ordered_dictset_closure_cell)DefaultAlreadySetErrorFrozenInstanceErrorNotAnAttrsClassErrorPythonTooOldErrorUnannotatedAttributeErrorz__attr_converter_{}z__attr_factory_{}z= {attr_name} = _attrs_property(_attrs_itemgetter({index})))ztyping.ClassVarz t.ClassVarZClassVarZ_attrs_cached_hashcs,eZdZdZdZfddZddZZS)_Nothingz Sentinel class to indicate the lack of a value when ``None`` is ambiguous. ``_Nothing`` is a singleton. There is only ever one of it. Ncs"tjdkrtt||t_tjSN)r _singletonsuper__new__cls __class__,/usr/lib/python3/dist-packages/attr/_make.pyr:s z_Nothing.__new__cCsdS)NNOTHINGrselfrrr__repr__?sz_Nothing.__repr__)__name__ __module__ __qualname____doc__rrr! __classcell__rrrrr1s rTFc Cst|| | \} } |dk r0|dk r0|dk r0td| dk r`|tk rHtdt| sXtdt| }|dkrli}t|||d|||||| | | d S)a Create a new attribute on a class. .. warning:: Does *not* do anything unless the class is also decorated with `attr.s`! :param default: A value that is used if an ``attrs``-generated ``__init__`` is used and no value is passed while instantiating or the attribute is excluded using ``init=False``. If the value is an instance of `Factory`, its callable will be used to construct a new value (useful for mutable data types like lists or dicts). If a default is not set (or set manually to ``attr.NOTHING``), a value *must* be supplied when instantiating; otherwise a `TypeError` will be raised. The default can also be set using decorator notation as shown below. :type default: Any value :param callable factory: Syntactic sugar for ``default=attr.Factory(callable)``. :param validator: `callable` that is called by ``attrs``-generated ``__init__`` methods after the instance has been initialized. They receive the initialized instance, the `Attribute`, and the passed value. The return value is *not* inspected so the validator has to throw an exception itself. If a ``list`` is passed, its items are treated as validators and must all pass. Validators can be globally disabled and re-enabled using `get_run_validators`. The validator can also be set using decorator notation as shown below. :type validator: ``callable`` or a ``list`` of ``callable``\ s. :param repr: Include this attribute in the generated ``__repr__`` method. If ``True``, include the attribute; if ``False``, omit it. By default, the built-in ``repr()`` function is used. To override how the attribute value is formatted, pass a ``callable`` that takes a single value and returns a string. Note that the resulting string is used as-is, i.e. it will be used directly *instead* of calling ``repr()`` (the default). :type repr: a ``bool`` or a ``callable`` to use a custom function. :param bool eq: If ``True`` (default), include this attribute in the generated ``__eq__`` and ``__ne__`` methods that check two instances for equality. :param bool order: If ``True`` (default), include this attributes in the generated ``__lt__``, ``__le__``, ``__gt__`` and ``__ge__`` methods. :param bool cmp: Setting to ``True`` is equivalent to setting ``eq=True, order=True``. Deprecated in favor of *eq* and *order*. :param hash: Include this attribute in the generated ``__hash__`` method. If ``None`` (default), mirror *eq*'s value. This is the correct behavior according the Python spec. Setting this value to anything else than ``None`` is *discouraged*. :type hash: ``bool`` or ``None`` :param bool init: Include this attribute in the generated ``__init__`` method. It is possible to set this to ``False`` and set a default value. In that case this attributed is unconditionally initialized with the specified default value or factory. :param callable converter: `callable` that is called by ``attrs``-generated ``__init__`` methods to converter attribute's value to the desired format. It is given the passed-in value, and the returned value will be used as the new value of the attribute. The value is converted before being passed to the validator, if any. :param metadata: An arbitrary mapping, to be used by third-party components. See `extending_metadata`. :param type: The type of the attribute. In Python 3.6 or greater, the preferred method to specify the type is using a variable annotation (see `PEP 526 `_). This argument is provided for backward compatibility. Regardless of the approach used, the type will be stored on ``Attribute.type``. Please note that ``attrs`` doesn't do anything with this metadata by itself. You can use it as part of your own code or for `static type checking `. :param kw_only: Make this attribute keyword-only (Python 3+) in the generated ``__init__`` (if ``init`` is ``False``, this parameter is ignored). .. versionadded:: 15.2.0 *convert* .. versionadded:: 16.3.0 *metadata* .. versionchanged:: 17.1.0 *validator* can be a ``list`` now. .. versionchanged:: 17.1.0 *hash* is ``None`` and therefore mirrors *eq* by default. .. versionadded:: 17.3.0 *type* .. deprecated:: 17.4.0 *convert* .. versionadded:: 17.4.0 *converter* as a replacement for the deprecated *convert* to achieve consistency with other noun-based arguments. .. versionadded:: 18.1.0 ``factory=f`` is syntactic sugar for ``default=attr.Factory(f)``. .. versionadded:: 18.2.0 *kw_only* .. versionchanged:: 19.2.0 *convert* keyword argument removed .. versionchanged:: 19.2.0 *repr* also accepts a custom callable. .. deprecated:: 19.2.0 *cmp* Removal on or after 2021-06-01. .. versionadded:: 19.2.0 *eq* and *order* NTF6Invalid value for hash. Must be True, False, or None.z=The `default` and `factory` arguments are mutually exclusive.z*The `factory` argument must be a callable.) default validatorreprcmphashinit convertermetadatatypekw_onlyeqorder)_determine_eq_order TypeErrorr ValueErrorcallableFactory _CountingAttr) r(r)r*r+r,r-r/r0r.factoryr1r2r3rrrattribIs:zr;cCsxd|}d|dg}|rDt|D]\}}|tj||dq$n |dttd}ttd|dd |||S) z Create a tuple subclass to hold `Attribute`s for an `attrs` class. The subclass is a bare tuple with properties for names. class MyClassAttributes(tuple): __slots__ = () x = property(itemgetter(0)) z {}Attributeszclass {}(tuple):z __slots__ = ())index attr_namez pass)Z_attrs_itemgetterZ_attrs_property exec) format enumerateappend_tuple_property_patrpropertyevalcompilejoin)Zcls_name attr_namesZattr_class_nameZattr_class_templateir=globsrrr_make_attr_tuple_classs    rL _Attributesattrs base_attrsZbase_attrs_mapcCst|tS)z Check whether *annot* is a typing.ClassVar. The string comparison hack is used to avoid evaluating all string annotations which would put attrs-based classes at a performance disadvantage compared to plain old classes. )str startswith_classvar_prefixes)Zannotrrr _is_class_varsrScCsHt|dd}|dkriS|jddD]}|t|ddkr&iSq&|S)z$ Get annotations for *cls*. __annotations__Nr)getattr__mro__)rannsbase_clsrrr_get_annotationss  rYcCs |djS)zQ Key function for sorting to avoid re-creating a lambda for every class. rcountererrr_counter_getter-sr^c sl|jt||dk r@ddt|D}t|ts>|jtdn|dkrddD}g}t}D]Z\}}t |rqn| | |t } t| t s| t krt} n t| d} ||| fqn||} t| d kr&td d t| fd d ddntddDdd d}fdd|D} g} i} dd| D}|jddD]\}t|dd}|dk r\|D]:} | | j}|dkrz| | | || j<|| | j<qzq\dd| | D}t|j|}|rdd| D} dd| D} || | }d}dd|DD]D} |dkr@| jt kr@td| f|dkr| jt k rd}qt|| | fS)z Transform all `_CountingAttr`s on a class into `Attribute`s. If *these* is passed, use that and don't look for them on the class. Return an `_Attributes`. NcSsg|]\}}||fqSrr).0namecarrr @sz$_transform_attrs..)keyTcSsh|]\}}t|tr|qSr isinstancer9r_r`attrrrr Es z#_transform_attrs..)r(rz1The following `attr.ib`s lack a type annotation: , cs |jSr)getr[)n)cdrr]z"_transform_attrs...css$|]\}}t|tr||fVqdSrrdrfrrr cs z#_transform_attrs..cSs |djSNrrZr\rrrrmhrncs&g|]\}}tj|||dqS))r`rar0) Attributefrom_counting_attrrj)r_r=ra)rWrrrbks cSsi|] }|j|qSrr`r_arrr tsz$_transform_attrs..r__attrs_attrs__cSsg|] }|jqSrrtrurrrrbscSsg|]}|jddqST)r1_assocrurrrrbscSsg|]}|jddqSrzr{rurrrrbsFcss&|]}|jdk r|jdkr|VqdS)FN)r-r1rurrrrps znNo mandatory attributes allowed after an attribute with a default value or factory. Attribute in question: %r)__dict__rYr rer sortr^itemssetrSaddrjrr9r;rClenrrHsortedrVrUr`rLr"r(r6rM)rthese auto_attribsr1Zca_listZca_namesZ annot_namesr=r0rvZ unannotatedZ own_attrsrO base_attr_mapZtaken_attr_namesrXZ sub_attrsZprev_arIZ AttrsClassrNZ had_defaultr)rWrlr_transform_attrs4s               rcCs tdS)z4 Attached to frozen classes as __setattr__. Nrr r`valuerrr_frozen_setattrssrcCs tdS)z4 Attached to frozen classes as __delattr__. Nr)r r`rrr_frozen_delattrssrc@s|eZdZdZdZddZddZddZd d Zd d Z d dZ ddZ ddZ ddZ ddZddZddZddZdS) _ClassBuilderz( Iteratively build *one* class. ) _cls _cls_dict_attrs _base_names _attr_names_slots_frozen _weakref_slot _cache_hash_has_post_init_delete_attribs_base_attr_map_is_excc Cst||||\} } } ||_|r(t|jni|_| |_tdd| D|_| |_t dd| D|_ ||_ |prt ||_ ||_||_tt|dd|_t| |_| |_|j|jd<|rt|jd<t|jd<dS) Ncss|] }|jVqdSrrtrurrrrpsz)_ClassBuilder.__init__..css|] }|jVqdSrrtrurrrrps__attrs_post_init__Fry __setattr__ __delattr__)rrdictr}rrrrrtuplerr_has_frozen_base_classrrrboolrUrrrrr) r rrslotsfrozen weakref_slotrr1 cache_hashis_excrNrOZbase_maprrr__init__s.     z_ClassBuilder.__init__cCsdj|jjdS)Nz<_ClassBuilder(cls={cls})>r)rArr"rrrrr!sz_ClassBuilder.__repr__cCs|jdkr|S|SdS)z Finalize class based on the accumulated configuration. Builder cannot be used after calling this method. TN)r_create_slots_class_patch_original_classrrrr build_classs z_ClassBuilder.build_classc Cs|j}|j}|jrZ|jD]@}||krt||ttk rzt||Wqtk rVYqXq|j D]\}}t |||qd|j rt|dd}|rt ddd}t |d||S)zA Apply accumulated methods and return the class. __setstate__NzCurrently you cannot use hash caching if you specify your own __setstate__ method.See https://github.com/python-attrs/attrs/issues/494 .cSst|tddSr)setattr_hash_cache_field)Z chss_self_rrrcache_hash_set_stateszA_ClassBuilder._patch_original_class..cache_hash_set_state) rrrrrU _sentineldelattrAttributeErrorrrrrNotImplementedError)r r base_namesr`rZexisting_set_state_methodrrrrrs.   z#_ClassBuilder._patch_original_classc sjfddtjD}d}jjddD]}dt|ddkr2d }qPq2j}jrdtjd dkrd|kr|s|d 7}fd d |D}jr| t t ||d <tjdd}|dk r||d<t ddjDfdd}jfdd}||d<||d<t jjj jj|} | jD]`} t| ttfrZt| jdd} n t| dd} | spq6| D]} | jjkrtt| | qtq6| S)zL Build and return a new class with a `__slots__` attribute. cs(i|] \}}|tjdkr||qS))r} __weakref__)rr)r_kvrrrrw)sz5_ClassBuilder._create_slots_class..Frrxrr}rT __slots__)rcsg|]}|kr|qSrrr_r`)rrrrbBsz5_ClassBuilder._create_slots_class..r$Ncss|]}|dkr|VqdS)rNr)r_ZanrrrrpLsz4_ClassBuilder._create_slots_class..cstfddDS)9 Automatically created by attrs. c3s|]}t|VqdSrrUrrrrrpTszL_ClassBuilder._create_slots_class..slots_getstate..rr)state_attr_namesrrslots_getstatePsz9_ClassBuilder._create_slots_class..slots_getstatecs<t|t}t|D]\}}|||qr8|tddS)rN) _obj_setattr__get__rrzipr)r stateZ_ClassBuilder__bound_setattrr`r)hash_caching_enabledrrrslots_setstateXs   z9_ClassBuilder._create_slots_class..slots_setstate __getstate__r __closure__)rr rrrVrUrrrrCrrr0r" __bases__r}valuesre classmethod staticmethod__func__ cell_contentsr ) r rlZweakref_inheritedrXnamesZ slot_namesqualnamerrritemZ closure_cellsZcellr)rrr rrr$sZ     z!_ClassBuilder._create_slots_classcCs|t|j|d|jd<|S)N)nsr!)_add_method_dunders _make_reprrr)r rrrradd_reprs z_ClassBuilder.add_reprcCs8|jd}|dkrtddd}|||jd<|S)Nr!z3__str__ can only be generated if a __repr__ exists.cSs|Sr)r!rrrr__str__sz&_ClassBuilder.add_str..__str__r)rrjr6r)r r*rrrradd_strs z_ClassBuilder.add_strcCsd|jd<|S)N__hash__)rrrrrmake_unhashables z_ClassBuilder.make_unhashablecCs(|t|j|j|j|jd|jd<|S)Nrrr)r _make_hashrrrrrrrrradd_hashs z_ClassBuilder.add_hashc Cs6|t|j|j|j|j|j|j|j|j |j d<|S)Nr) r _make_initrrrrrrrrrrrrradd_inits z_ClassBuilder.add_initcs2j}fddtjjD\|d<|d<S)Nc3s|]}|VqdSrrr_methrrrrpsz'_ClassBuilder.add_eq..__eq____ne__)r_make_eqrrr rlrrradd_eqs   z_ClassBuilder.add_eqcs>j}fddtjjD\|d<|d<|d<|d<S)Nc3s|]}|VqdSrrrrrrrpsz*_ClassBuilder.add_order..__lt____le____gt____ge__)r _make_orderrrrrrr add_orders   z_ClassBuilder.add_ordercCsXz|jj|_Wntk r"YnXzd|jj|jf|_Wntk rRYnX|S)zL Add __module__ and __qualname__ to a *method* if possible. ro)rr#rrHr$r")r methodrrrrs z!_ClassBuilder._add_method_dundersN)r"r#r$r%rrr!rrrrrrrrrrrrrrrrs$ 0`    rzrThe usage of `cmp` is deprecated and will be removed on or after 2021-06-01. Please use `eq` and `order` instead.cCs||dk r$t|dk |dk fr$td|dk rDtjttdd||fS|dkrPd}|dkr\|}|dkrt|dkrttd||fS)zp Validate the combination of *cmp*, *eq*, and *order*. Derive the effective values of eq and order. Nz&Don't mix `cmp` with `eq' and `order`. stacklevelTFz-`order` can only be True if `eq` is True too.)anyr6warningswarn_CMP_DEPRECATIONDeprecationWarning)r+r2r3rrrr4sr4csPt|\ fdd}|dkrD|S||SdS)a A class decorator that adds `dunder `_\ -methods according to the specified attributes using `attr.ib` or the *these* argument. :param these: A dictionary of name to `attr.ib` mappings. This is useful to avoid the definition of your attributes within the class body because you can't (e.g. if you want to add ``__repr__`` methods to Django models) or don't want to. If *these* is not ``None``, ``attrs`` will *not* search the class body for attributes and will *not* remove any attributes from it. If *these* is an ordered dict (`dict` on Python 3.6+, `collections.OrderedDict` otherwise), the order is deduced from the order of the attributes inside *these*. Otherwise the order of the definition of the attributes is used. :type these: `dict` of `str` to `attr.ib` :param str repr_ns: When using nested classes, there's no way in Python 2 to automatically detect that. Therefore it's possible to set the namespace explicitly for a more meaningful ``repr`` output. :param bool repr: Create a ``__repr__`` method with a human readable representation of ``attrs`` attributes.. :param bool str: Create a ``__str__`` method that is identical to ``__repr__``. This is usually not necessary except for `Exception`\ s. :param bool eq: If ``True`` or ``None`` (default), add ``__eq__`` and ``__ne__`` methods that check two instances for equality. They compare the instances as if they were tuples of their ``attrs`` attributes, but only iff the types of both classes are *identical*! :type eq: `bool` or `None` :param bool order: If ``True``, add ``__lt__``, ``__le__``, ``__gt__``, and ``__ge__`` methods that behave like *eq* above and allow instances to be ordered. If ``None`` (default) mirror value of *eq*. :type order: `bool` or `None` :param cmp: Setting to ``True`` is equivalent to setting ``eq=True, order=True``. Deprecated in favor of *eq* and *order*, has precedence over them for backward-compatibility though. Must not be mixed with *eq* or *order*. :type cmp: `bool` or `None` :param hash: If ``None`` (default), the ``__hash__`` method is generated according how *eq* and *frozen* are set. 1. If *both* are True, ``attrs`` will generate a ``__hash__`` for you. 2. If *eq* is True and *frozen* is False, ``__hash__`` will be set to None, marking it unhashable (which it is). 3. If *eq* is False, ``__hash__`` will be left untouched meaning the ``__hash__`` method of the base class will be used (if base class is ``object``, this means it will fall back to id-based hashing.). Although not recommended, you can decide for yourself and force ``attrs`` to create one (e.g. if the class is immutable even though you didn't freeze it programmatically) by passing ``True`` or not. Both of these cases are rather special and should be used carefully. See our documentation on `hashing`, Python's documentation on `object.__hash__`, and the `GitHub issue that led to the default \ behavior `_ for more details. :type hash: ``bool`` or ``None`` :param bool init: Create a ``__init__`` method that initializes the ``attrs`` attributes. Leading underscores are stripped for the argument name. If a ``__attrs_post_init__`` method exists on the class, it will be called after the class is fully initialized. :param bool slots: Create a `slotted class ` that's more memory-efficient. :param bool frozen: Make instances immutable after initialization. If someone attempts to modify a frozen instance, `attr.exceptions.FrozenInstanceError` is raised. Please note: 1. This is achieved by installing a custom ``__setattr__`` method on your class, so you can't implement your own. 2. True immutability is impossible in Python. 3. This *does* have a minor a runtime performance `impact ` when initializing new instances. In other words: ``__init__`` is slightly slower with ``frozen=True``. 4. If a class is frozen, you cannot modify ``self`` in ``__attrs_post_init__`` or a self-written ``__init__``. You can circumvent that limitation by using ``object.__setattr__(self, "attribute_name", value)``. :param bool weakref_slot: Make instances weak-referenceable. This has no effect unless ``slots`` is also enabled. :param bool auto_attribs: If True, collect `PEP 526`_-annotated attributes (Python 3.6 and later only) from the class body. In this case, you **must** annotate every field. If ``attrs`` encounters a field that is set to an `attr.ib` but lacks a type annotation, an `attr.exceptions.UnannotatedAttributeError` is raised. Use ``field_name: typing.Any = attr.ib(...)`` if you don't want to set a type. If you assign a value to those attributes (e.g. ``x: int = 42``), that value becomes the default value like if it were passed using ``attr.ib(default=42)``. Passing an instance of `Factory` also works as expected. Attributes annotated as `typing.ClassVar`, and attributes that are neither annotated nor set to an `attr.ib` are **ignored**. .. _`PEP 526`: https://www.python.org/dev/peps/pep-0526/ :param bool kw_only: Make all attributes keyword-only (Python 3+) in the generated ``__init__`` (if ``init`` is ``False``, this parameter is ignored). :param bool cache_hash: Ensure that the object's hash code is computed only once and stored on the object. If this is set to ``True``, hashing must be either explicitly or implicitly enabled for this class. If the hash code is cached, avoid any reassignments of fields involved in hash code computation or mutations of the objects those fields point to after object creation. If such changes occur, the behavior of the object's hash code is undefined. :param bool auto_exc: If the class subclasses `BaseException` (which implicitly includes any subclass of any exception), the following happens to behave like a well-behaved Python exceptions class: - the values for *eq*, *order*, and *hash* are ignored and the instances compare and hash by the instance's ids (N.B. ``attrs`` will *not* remove existing implementations of ``__hash__`` or the equality methods. It just won't add own ones.), - all attributes that are either passed into ``__init__`` or have a default value are additionally available as a tuple in the ``args`` attribute, - the value of *str* is ignored leaving ``__str__`` to base classes. .. versionadded:: 16.0.0 *slots* .. versionadded:: 16.1.0 *frozen* .. versionadded:: 16.3.0 *str* .. versionadded:: 16.3.0 Support for ``__attrs_post_init__``. .. versionchanged:: 17.1.0 *hash* supports ``None`` as value which is also the default now. .. versionadded:: 17.3.0 *auto_attribs* .. versionchanged:: 18.1.0 If *these* is passed, no attributes are deleted from the class body. .. versionchanged:: 18.1.0 If *these* is ordered, the order is retained. .. versionadded:: 18.2.0 *weakref_slot* .. deprecated:: 18.2.0 ``__lt__``, ``__le__``, ``__gt__``, and ``__ge__`` now raise a `DeprecationWarning` if the classes compared are subclasses of each other. ``__eq`` and ``__ne__`` never tried to compared subclasses to each other. .. versionchanged:: 19.2.0 ``__lt__``, ``__le__``, ``__gt__``, and ``__ge__`` now do not consider subclasses comparable anymore. .. versionadded:: 18.2.0 *kw_only* .. versionadded:: 18.2.0 *cache_hash* .. versionadded:: 19.1.0 *auto_exc* .. deprecated:: 19.2.0 *cmp* Removal on or after 2021-06-01. .. versionadded:: 19.2.0 *eq* and *order* c sHt|dddkrtddko(t|t}t| | } dkrT|  dkrd|dkrx|sx|dkr|s|dk rdk rdk rtdnpdksʈdkrƈdks|r؈rtdnFdksdkrdkrdkr| nrtd| dkr2| nr@td| S)Nrz(attrs only works with new-style classes.TFr'zlInvalid value for cache_hash. To use hash caching, hashing must be either explicitly or implicitly enabled.zFInvalid value for cache_hash. To use hash caching, init must be True.) rUr5 issubclass BaseExceptionrrrrrrrrr)rrZbuilderrauto_excrr2rr,r-r1r3r*repr_nsrrPrrrrwrapsZ    &   zattrs..wrapN)r4)Z maybe_clsrrr*r+r,r-rrrrPrr1rrr2r3rrrrrNs 2(DcCs"t|jddtjko |jjtjkS)b Check whether *cls* has a frozen ancestor by looking at its __setattr__. r#N)rUrrr#r"rrrrrs   rcCs |jtkS)r)rrrrrrrscstfdd|DS)z: Create a tuple of all values of *obj*'s *attrs*. c3s|]}t|jVqdSr)rUr`ruobjrrrpsz"_attrs_to_tuple..r)rrNrrr_attrs_to_tuplesrcCslt}d}d}d||jt|d|j|}ddt|f|f}tj |||krT|S|d7}d|}qdS)zF Create a "filename" suitable for a function being generated. r?rz r$Nz-{0}) uuidZuuid4rAr#rUr"rP linecachecache setdefault)rZ func_nameZ unique_idZextracountunique_filenameZ cache_linerrr_generate_unique_filename"s"   rc stddDd}t|d}t|dgfdd}|r|dt|r~|d t|d |d d n|d t|d |d tn |d|d}i}i} t||d} t| || t|d| d|ft j |<| dS)Ncss0|](}|jdks$|jdkr|jdkr|VqdS)TN)r,r2rurrrrpAs  z_make_hash..z r,zdef __hash__(self):csP||d|dfgD]}|d|jq$|ddS)z Generate the code for actually computing the hash code. Below this will either be returned directly or used to compute a value which is then cached, depending on the value of cache_hash zhash((z %d, self.%s,z ))N)extendrCr`)prefixindentrvrNZ method_linesZ type_hashrrappend_hash_computation_linesLs z1_make_hash..append_hash_computation_lineszif self.%s is None:zobject.__setattr__(self, '%s', )z self.%s = zreturn self.%szreturn r>r@Tr) rrr,rCrrHrGrFr splitlinesrr) rrNrrZtabrr scriptrKlocsbytecoderr rr@sB      rcCst||ddd|_|S)z% Add a hash method to *cls*. Fr)rrrrNrrr _add_hash|srcCs||}|tkrtS| S)z^ Check equality and either forward a NotImplemented or return the result negated. )rNotImplemented)r otherresultrrrrs rc Csdd|D}t|d}dddg}|rt|ddg}|D](}|d |jf|d |jfq:||d g7}n |d d |}i}i}t||d} t| ||t|d|d|ftj |<|dt fS)NcSsg|]}|jr|qSr)r2rurrrrbsz_make_eq..r2zdef __eq__(self, other):z- if other.__class__ is not self.__class__:z return NotImplementedz return (z ) == (rz other.%s,z )z return Truer>r@Tr) rrCr`rHrGrFrr rrr) rrNrlinesZothersrvrrKrrrrrrs2       rcsVddDfddfdd}fdd}fd d }fd d }||||fS) NcSsg|]}|jr|qSr)r3rurrrrbsz_make_order..cs t|S)z& Save us some typing. )rrrNrrattrs_to_tuplesz#_make_order..attrs_to_tuplecs |j|jkr||kStS1 Automatically created by attrs. rrr rrrrrs z_make_order..__lt__cs |j|jkr||kStSrrrrrrrs z_make_order..__le__cs |j|jkr||kStSrrrrrrrs z_make_order..__gt__cs |j|jkr||kStSrrrrrrrs z_make_order..__ge__r)rrNrrrrr)rNrrrs  rcCs$|dkr|j}t||\|_|_|S)z5 Add equality methods to *cls* with *attrs*. N)ryrrrrrrr_add_eqsrcs$tdd|Dfdd}|S)z^ Make a repr method that includes relevant *attrs*, adding *ns* to the full name. css2|]*}|jdk r|j|jdkr"tn|jfVqdS)FTN)r*r`rurrrrps z_make_repr..c sz tj}Wn tk r*t}|t_YnXt||kr.rrxro(TFri=r?r )_already_repring working_setrridrrUrsplitr"rremoverCrrrH) r r"Zreal_clsr class_namerfirstr`Z attr_reprZattr_names_with_reprsrrrr!s6      z_make_repr..__repr__r)rNrr!rr(rrs *rcCs|dkr|j}t|||_|S)z% Add a repr method to *cls*. N)ryrr!)rrrNrrr _add_repr1s r)cCsdd|D}t|d}t|||||||\} } } i} t| |d} tdd|D}| t|d|dkrtt| d <t| | | t| d| d|ft j |<| d }| |_ |S) NcSs g|]}|js|jtk r|qSr)r-r(rrurrrrb?s z_make_init..r-r@css|]}|j|fVqdSrrtrurrrrpHsz_make_init..)r attr_dictTZ_cached_setattrr) r_attrs_to_init_scriptrGrupdaterrrFrr rrrT)rrN post_initrrrrrrrrK annotationsrrr*rrrrr<s4     rcCs8t|stdt|dd}|dkr4tdj|d|S)a Return the tuple of ``attrs`` attributes for a class. The tuple also allows accessing the fields by their names (see below for examples). :param type cls: Class to introspect. :raise TypeError: If *cls* is not a class. :raise attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs`` class. :rtype: tuple (with name accessors) of `attr.Attribute` .. versionchanged:: 16.2.0 Returned tuple allows accessing the fields by name. Passed object must be a class.ryN({cls!r} is not an attrs-decorated class.r)r r5rUrrArrrrfieldsas  r1cCsFt|stdt|dd}|dkr4tdj|dtdd|DS)a8 Return an ordered dictionary of ``attrs`` attributes for a class, whose keys are the attribute names. :param type cls: Class to introspect. :raise TypeError: If *cls* is not a class. :raise attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs`` class. :rtype: an ordered dict where keys are attribute names and values are `attr.Attribute`\ s. This will be a `dict` if it's naturally ordered like on Python 3.6+ or an :class:`~collections.OrderedDict` otherwise. .. versionadded:: 18.1.0 r/ryNr0rcss|]}|j|fVqdSrrtrurrrrpszfields_dict..)r r5rUrrAr rrrr fields_dict}s  r2cCsDtjdkrdSt|jD]&}|j}|dk r|||t||jqdS)z Validate all attributes on *inst* that have a validator. Leaves all exceptions through. :param inst: Instance of a class with ``attrs`` attributes. FN)rZ_run_validatorsr1rr)rUr`)instrvrrrrvalidates  r4cCs d|jkS)Nr)r}rrrr _is_slot_clssr5cCs||kot||S)z> Check if the attribute name comes from a slot class. )r5)Za_namerrrr _is_slot_attrsr6c sg}tfdd|D}|dkrx|dkrF|ddd} dd} q|d |r^|dfd d} fd d} nd d} d d} g} g} g} i}ddi}|D] }|jr| ||j}|jd}t|jt}|r|jjrd}nd}|j dkr|rrt |j}|j dk rJ|| ||d |t |j}|j ||<n|| ||d ||jj||<nT|j dk r|| |dj |dt |j}|j ||<n|| |dj |dn|jtk rL|sLdj ||d}|jr| |n | ||j dk r8|| |||j |t |j<n|| ||nR|r@dj |d}|jrr| |n | ||dj |dt |j}|j dk r|d| |||d|d| ||d ||j |t |j<n<|d| |||d|d| ||d ||jj||<n^|jrT| |n | ||j dk r|| |||j |t |j<n|| |||j dkr|j dkr|jdk r|j||<q| r,t|d<|d| D]F}d |j}d! |j}|d" |||j|j||<|||<q|r<|d#|rp|rZ|rTd$}nd%}nd&}||td'f|rd(d)d|D}|d*|fd+| } | rtrtd,| d-j | rd+ndd+| d.7} d/j | |rd0|nd1d2||fS)3z Return a script of an initializer for *attrs* and a dict of globals. The globals are expected by the generated script. If *frozen* is True, we cannot set the attributes directly so we use a cached ``object.__setattr__``. c3s|]}t|jVqdSr)r6r`rurrrrpsz(_attrs_to_init_script..Tz8_setattr = _cached_setattr.__get__(self, self.__class__)cSsd||dS)N(_setattr('%(attr_name)s', %(value_var)s)r= value_varrr9rrr fmt_settersz)_attrs_to_init_script..fmt_settercSst|}d|||dS)Nz2_setattr('%(attr_name)s', %(conv)s(%(value_var)s))r=r:Zconv_init_converter_patrAr=r: conv_namerrrfmt_setter_with_converters  z8_attrs_to_init_script..fmt_setter_with_converterz_inst_dict = self.__dict__cs,t|rd||d}nd||d}|S)Nr8r9z+_inst_dict['%(attr_name)s'] = %(value_var)s)r6)r=r:resr7rrr;s  cs.t|}t|rd}nd}||||dS)Nz/_setattr('%(attr_name)s', %(c)s(%(value_var)s))z2_inst_dict['%(attr_name)s'] = %(c)s(%(value_var)s))r=r:c)r>rAr6)r=r:r@Ztmplr7rrrAs  cSsd||dS)Nzself.%(attr_name)s = %(value)sr=rrrDrrrr;scSst|}d|||dS)Nz,self.%(attr_name)s = %(conv)s(%(value_var)s)r<r=r?rrrrA s  returnNrr r?Fz({0})z attr_dict['{attr_name}'].default)r=z+{arg_name}=attr_dict['{attr_name}'].default)arg_namer=z{arg_name}=NOTHING)rFzif {arg_name} is not NOTHING:z zelse:rz#if _config._run_validators is True:z__attr_validator_{}z __attr_{}z {}(self, {}, self.{})zself.__attrs_post_init__()z_setattr('%s', %s)z_inst_dict['%s'] = %sz self.%s = %sNone,css|]}|jrd|jVqdS)zself.N)r-r`rurrrrpsz BaseException.__init__(self, %s)riz7Keyword-only arguments only work on Python 3 and later.z {leading_comma}*, {kw_only_args})Z leading_comma kw_only_argsz(def __init__(self, {args}): {lines} z pass)argsr)rrCr)r`lstriprer(r8 takes_selfr-_init_factory_patrAr.r>r:rr1r0rrrHrr)rNrrr-rrrrZany_slot_ancestorsr;rArKrIZattrs_to_validateZnames_for_globalsr.rvr=rFZ has_factoryZ maybe_selfZinit_factory_namer@argZval_nameZinit_hash_cachevalsrr7rr+s`                                                 r+c@s`eZdZdZdZdddZddZedd d Ze d d Z d dZ ddZ ddZ ddZdS)rra  *Read-only* representation of an attribute. :attribute name: The name of the attribute. Plus *all* arguments of `attr.ib` (except for ``factory`` which is only syntactic sugar for ``default=Factory(...)``. For the version history of the fields, see `attr.ib`. ) r`r(r)r*r2r3r,r-r/r0r.r1NFcCst|| | \} } t|t}|d||d||d||d||d| |d| |d||d||d | |d |rt|nt|d | |d | dS) Nr`r(r)r*r2r3r,r-r.r/r0r1)r4rrrrr _empty_metadata_singleton)r r`r(r)r*r+r,r-r/r0r.r1r2r3 bound_setattrrrrrs&            zAttribute.__init__cCs tdSrrrrrrrszAttribute.__setattr__csT|dkrj}njdk r"tdfddtjD}|f|jj|dd|S)Nz8Type annotation and type argument cannot both be presentcs i|]}|dkr|t|qS))r`r)r(r0r)r_rrarrrws z0Attribute.from_counting_attr..)r`r)r(r0r+)r0r6rrr _validator_default)rr`rar0Z inst_dictrrSrrss$   zAttribute.from_counting_attrcCstjttdd|jo|jS)zD Simulate the presence of a cmp attribute and warn. r r)rrrrr2r3rrrrr+3sz Attribute.cmpcKst|}|||S)z2 Copy *self* and apply *changes*. )copy _setattrsr)r Zchangesnewrrrr|=s zAttribute._assoccstfddjDS)( Play nice with pickle. c3s*|]"}|dkrt|ntjVqdS)r/N)rUrr/rrrrrpLsz)Attribute.__getstate__..)rrrrrrrHs zAttribute.__getstate__cCs|t|j|dS)rYN)rWrr)r rrrrrQszAttribute.__setstate__cCsHt|t}|D]2\}}|dkr,|||q|||r)r[rUr*r2r3r,r-r/NTFr[rc Csztjd7_tj|_||_|r:t|ttfr:t||_n||_||_ | |_ | |_ ||_ ||_ ||_||_| |_| |_dSrq)r9 cls_counterr[rUrelistrand_rTr*r2r3r,r-r.r/r0r1) r r(r)r*r+r,r-r.r/r0r1r2r3rrrrs z_CountingAttr.__init__cCs$|jdkr||_nt|j||_|S)z Decorator that adds *meth* to the list of validators. Returns *meth* unchanged. .. versionadded:: 17.1.0 N)rTr^r rrrrr)s z_CountingAttr.validatorcCs"|jtk rtt|dd|_|S)z Decorator that allows to set the default for an attribute. Returns *meth* unchanged. :raises DefaultAlreadySetError: If default has been set before. .. versionadded:: 17.1.0 T)rM)rUrrr8r_rrrr(s z_CountingAttr.default) r"r#r$r%rrrrryr\rr)r(rrrrr9zs. $!r9)rr-r,c@s&eZdZdZeZeZdddZdS)r8a Stores a factory callable. If passed as the default value to `attr.ib`, the factory is used to generate a new value. :param callable factory: A callable that takes either none or exactly one mandatory positional argument depending on *takes_self*. :param bool takes_self: Pass the partially initialized instance that is being initialized as a positional argument. .. versionadded:: 17.1.0 *takes_self* FcCs||_||_dS)z `Factory` is part of the default machinery so if we want a default value here, we have to implement it ourselves. N)r:rM)r r:rMrrrrszFactory.__init__N)F)r"r#r$r%r;r:rMrrrrrr8sr8c Kst|tr|}n*t|ttfr2tdd|D}ntd|dd}t|||dkrXind|i}ztdj dd|_ Wnt t fk rYnX|d d}t|| d | d \|d <|d <tfd |i||S) aR A quick way to create a new class called *name* with *attrs*. :param name: The name for the new class. :type name: str :param attrs: A list of names or a dictionary of mappings of names to attributes. If *attrs* is a list or an ordered dict (`dict` on Python 3.6+, `collections.OrderedDict` otherwise), the order is deduced from the order of the names or attributes inside *attrs*. Otherwise the order of the definition of the attributes is used. :type attrs: `list` or `dict` :param tuple bases: Classes that the new class will subclass. :param attributes_arguments: Passed unmodified to `attr.s`. :return: A new class with *attrs*. :rtype: type .. versionadded:: 17.1.0 *bases* .. versionchanged:: 18.1.0 If *attrs* is ordered, the order is retained. css|]}|tfVqdSr)r;rurrrrp4szmake_class..z(attrs argument must be a dict or a list.rNrr"__main__r+r2r3r)rerr]rr5popr0sys _getframe f_globalsrjr#rr6r4r)r`rNbasesZattributes_argumentsZcls_dictr-Ztype_r+rrr make_classs8       rf)rr,c@seZdZdZeZddZdS) _AndValidatorz2 Compose many validators to a single one. cCs|jD]}||||qdSr) _validators)r r3rgrrrrr__call__`s z_AndValidator.__call__N)r"r#r$r%r;rhrirrrrrgXsrgcGs6g}|D] }|t|tr |jn|gqtt|S)z A validator that composes multiple validators into one. When called on a value, it runs all wrapped validators. :param validators: Arbitrary number of validators. :type validators: callables .. versionadded:: 17.1.0 )rrergrhr)Z validatorsrPr)rrrr^es r^)NNNTNNTFFTFFFFFNN)N)NN)QZ __future__rrrrVrrbZ threadingrroperatorrr?rZ_compatrr r r r r exceptionsrrrrrobjectrrr>rNrDrRrrQrrrr;rLrMrSrYr^rrrrrr4rNrrrrrrrrrrZlocalr!rr)rr1r2r4r5r6r+rrrZ_ar9r8rfrgr^rrrrs       k4 ~ < '0 ; %  ~  A