ÿØÿà 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ÿÙ 3 Wj@sddlZddlZddlZddlZddlZddlZejdkrHddlmZn ddlmZejd krlddl m Z n ddl m Z e ej ejejejejgZiZd!ddZd"d d ZGd d d ejejejZGd ddeZGdddeZGdddeZGdddeZdZ dZ!dZ"dZ#Gdddej$Z$ddZ%ddZ&ej'j%ej'_(e%ej'_%ej)Z)ejZejZejZej*Z*ej+Z+ej,Z,ej-Z-ej.Z.ej/Z/ej0Z0ej1Z1ej2Z2ej3Z3eZ4eZ5eZ6eZ7eZ8eZ9e$Z:e$Z;ej'j%ej'_e$_?e$j@e$_AeZBeZCeZDdS)#N)StringIO) OrderedDictcKsT|dkr d}|tkr(td|t|f|jdtj|jddtf|t|<dS)zCreates a global ArgumentParser instance with the given name, passing any args other than "name" to the ArgumentParser constructor. This instance can then be retrieved using get_argument_parser(..) Ndefaultzbkwargs besides 'name' can only be passed in the first time. '%s' ArgumentParser already exists: %sformatter_classconflict_handlerZresolve)_parsers ValueError setdefaultargparseArgumentDefaultsHelpFormatterArgumentParser)namekwargsr0/usr/lib/python3/dist-packages/configargparse.pyinit_argument_parsers rcKs4|dkr d}t|dks |tkr,t|f|t|S)a Returns the global ArgumentParser instance with the given name. The 1st time this function is called, a new ArgumentParser instance will be created for the given name, and any args other than "name" will be passed on to the ArgumentParser constructor. Nrr)lenr r)rrrrrget_argument_parser.s  rc@seZdZdZdS) ArgumentDefaultsRawHelpFormatterzCHelpFormatter that adds default values AND doesn't do line-wrappingN)__name__ __module__ __qualname____doc__rrrrr=src@s(eZdZdZddZddZddZdS) ConfigFileParserzRThis abstract class can be extended to add support for new config file formatscCs tddS)z3Returns a string describing the config file syntax.z*get_syntax_description(..) not implementedN)NotImplementedError)selfrrrget_syntax_descriptionIsz'ConfigFileParser.get_syntax_descriptioncCs tddS)aNParses the keys and values from a config file. NOTE: For keys that were specified to configargparse as action="store_true" or "store_false", the config file value must be one of: "yes", "no", "true", "false". Otherwise an error will be raised. Args: stream: A config file input stream (such as an open file object). Returns: OrderedDict of items where the keys have type string and the values have type either string or list (eg. to support config file formats like YAML which allow lists). zparse(..) not implementedN)r)rstreamrrrparseMszConfigFileParser.parsecCs tddS)aDoes the inverse of config parsing by taking parsed values and converting them back to a string representing config file contents. Args: items: an OrderedDict of items to be converted to the config file format. Keys should be strings, and values should be either strings or lists. Returns: Contents of config file as a string zserialize(..) not implementedN)r)ritemsrrr serialize^s zConfigFileParser.serializeN)rrrrrr!r#rrrrrEsrc@seZdZdZdS)ConfigFileParserExceptionz'Raised when config file parsing failed.N)rrrrrrrrr$msr$c@s(eZdZdZddZddZddZdS) DefaultConfigFileParseraBased on a simplified subset of INI and YAML formats. Here is the supported syntax: # this is a comment ; this is also a comment (.ini style) --- # lines that start with --- are ignored (yaml style) ------------------- [section] # .ini-style section names are treated as comments # how to specify a key-value pair (all of these are equivalent): name value # key is case sensitive: "Name" isn't "name" name = value # (.ini style) (white space is ignored, so name = value same as name=value) name: value # (yaml style) --name value # (argparse style) # how to set a flag arg (eg. arg which has action="store_true") --name name name = True # "True" and "true" are the same # how to specify a list arg (eg. arg which has action="append") fruit = [apple, orange, lemon] indexes = [1, 12, 35 , 40] cCsd}|S)NzrConfig file syntax allows: key=value, flag=true, stuff=[a,b,c] (for details, see syntax at https://goo.gl/R74nmi).r)rmsgrrrrsz.DefaultConfigFileParser.get_syntax_descriptionc Cs&t}xt|D] \}}|j}| s|ddks|jdrBqd}d}|d|d }|d }tjd ||d |} | r| jd }d||<qtjd |||d |} | r| jd }| jd}|jdo|jdrdd|ddjdD}|||<qt d|t |dd|fqW|S)z,Parses the keys + values from a config file.r#;[z---z\s*z(?P[^:=;#\s]+?)z[:=\s]z(?P.+?)z(?P\s[;#].*)?^$keytruevalue]cSsg|] }|jqSr)strip).0elemrrr sz1DefaultConfigFileParser.parse..,zUnexpected line %s in %s: %srr )r'r(r)) r enumerater0 startswithrematchgroupendswithsplitr$getattr) rr r"ilineZ white_spacer,r.ZcommentZkey_only_matchZkey_value_matchrrrr!s2   zDefaultConfigFileParser.parsecCsZt}xJ|jD]>\}}t|tkrrrr"rBrE)rr rJZ parsed_objeresultr,r.rrrr!s   zYAMLConfigFileParser.parseFcCs|j}t|}|j||dS)zDoes the inverse of config parsing by taking parsed values and converting them back to a string representing config file contents. Args: default_flow_style: defines serialization format (see PyYAML docs) )default_flow_style)rLrNdump)rr"rQrJrrrr#s zYAMLConfigFileParser.serializeN)F)rrrrrrLr!r#rrrrrIs  rIZ command_lineZenvironment_variables config_filedefaultsc@seZdZdZdddddgejddddddddgdegddgddfd d Zdddej fd d Z dddej fd dZ ddZ ddZ ddZddZddZddZejfddZddZdS)rzDrop-in replacement for argparse.ArgumentParser that adds support for environment variables and .ini or .yaml-style config files. N-errorTFzconfig file pathzftakes the current command line args and writes them out to a config file at the given path, then exitscCs| |_||_||_tddtjD}tjdkrBd|krB|d=tjdkrT||d<tj j |f||dkrvt |_ n||_ ||_ ||_|r|j|d||d d |r|j|d d |d d dS)a/ Supports all the same args as the argparse.ArgumentParser constructor, as well as the following additional args. Additional Args: add_config_file_help: Whether to add a description of config file syntax to the help message. add_env_var_help: Whether to add something to the help message for args that can be set through environment variables. auto_env_var_prefix: If set to a string instead of None, all config- file-settable options will become also settable via environment variables whose names are this prefix followed by the config file key, all in upper case. (eg. setting this to "foo_" will allow an arg like "--my-arg" to also be set via the FOO_MY_ARG environment variable) default_config_files: When specified, this list of config files will be parsed in order, with the values from each config file taking precedence over pervious ones. This allows an application to look for config files in multiple standard locations such as the install directory, home directory, and current directory. Also, shell * syntax can be used to specify all conf files in a directory. For exmaple: ["/etc/conf/app_config.ini", "/etc/conf/conf-enabled/*.ini", "~/.my_app_config.ini", "./app_config.txt"] ignore_unknown_config_file_keys: If true, settings that are found in a config file but don't correspond to any defined configargparse args will be ignored. If false, they will be processed and appended to the commandline like other args, and can be retrieved using parse_known_args() instead of parse_args() config_file_parser_class: configargparse.ConfigFileParser subclass which determines the config file format. configargparse comes with DefaultConfigFileParser and YAMLConfigFileParser. args_for_setting_config_path: A list of one or more command line args to be used for specifying the config file path (eg. ["-c", "--config-file"]). Default: [] config_arg_is_required: When args_for_setting_config_path is set, set this to True to always require users to provide a config path. config_arg_help_message: the help message to use for the args listed in args_for_setting_config_path. args_for_writing_out_config_file: A list of one or more command line args to use for specifying a config file output path. If provided, these args cause configargparse to write out a config file with settings based on the other provided commandline args, environment variants and defaults, and then to exit. (eg. ["-w", "--write-out-config-file"]). Default: [] write_out_config_file_arg_help_message: The help message to use for the args in args_for_writing_out_config_file. allow_abbrev: Allows long options to be abbreviated if the abbreviation is unambiguous. Default: True css"|]\}}|d kr||fVqd S)progusage descriptionepilogversionparentsr prefix_charsfromfile_prefix_charsargument_defaultr add_helpN) rWrXrYrZr[r\rr]r^r_r r`r)r1kvrrr fsz*ArgumentParser.__init__..rr[ allow_abbrevNrST)destZrequiredhelpis_config_file_argZ"write_out_config_file_to_this_pathZCONFIG_OUTPUT_PATH)rfmetavarrgis_write_out_config_file_arg)rr)rrd)_add_config_file_help_add_env_var_help_auto_env_var_prefixrNlocalsr"sys version_infor r__init__r%_config_file_parser_default_config_files _ignore_unknown_config_file_keys add_argument)rrWrXrYrZr[r\rr]r^r_r r`Zadd_config_file_helpZadd_env_var_helpZauto_env_var_prefixdefault_config_filesZignore_unknown_config_file_keysZconfig_file_parser_classZargs_for_setting_config_pathZconfig_arg_is_requiredZconfig_arg_help_messageZ args_for_writing_out_config_fileZ&write_out_config_file_arg_help_messagereZkwargs_for_superrrrrq s0U   zArgumentParser.__init__cCs2|j||||d\}}|r.|jddj||S)aTSupports all the same args as the ArgumentParser.parse_args(..), as well as the following additional args. Additional Args: args: a list of args as in argparse, or a string (eg. "-x -y bla") config_file_contents: String. Used for testing. env_vars: Dictionary. Used for testing. )args namespaceconfig_file_contentsenv_varszunrecognized arguments: %s )parse_known_argsrVrC)rrwrxryrzargvrrr parse_argss  zArgumentParser.parse_argsc"sDdkrtjddnttkr.jntt}xVD]N}|r|djkrd|kr|jdd\}}|j||j|qB|j|qBW|xjD]} | j | _ qWt _ rdtf} d| ij t <jdk rZxtjD]j} j| } | r| jp*| j p*| jp*| jp*t| tjk r| djj} j| jddj| _qWg} fdd jD}x.|D]&}|j}|}| j|||7} qzW| | rt fd d |Dj t<td d jD}|od kpdk}tfdd jD}g}|r2t|}d|_|g}n|sBj}x t|D]}zDyj j!|}Wn.t"k r}zj#|WYdd}~XnXWdt$|dr|j%Xg}x|j&D]\}}||kr||}t'|j }nd}j(pt'j)|}|s|j|||7}dt*|jf}|j kr@t j |<||fj ||<qW|qNWt }xjD]}|j p|j+t,t-gk}t'|j st| st|j.dkst|j.t/kstt|t0krҐqtn,|j r|j d}n|j1}|t|j.f||<qtW|r|j t2<tj3j4|d\}}dd jD}|r.cs g|]}|j||jffqSr)r)r1r)rzrrr3scss |]}t|tjkr|VqdS)N)rAr _HelpAction)r1rrrrrcsz2ArgumentParser.parse_known_args..z-hz--helpc3s&|]}j|D]}||fVqqdS)N)get_possible_config_keys)r1actionZ config_key)rrrrcsz method argclosez%s|%s)rwrxcSsg|]}t|ddr|qS)rjF)r>)r1rrrrr3.swz Couldn't open %s for writing: %szWrote config file to r6)>ror}rArEr=rBr]append_actionsrrr_source_to_settings_COMMAND_LINE_SOURCE_KEYrmrrrhrjr rr0replaceupper convert_item_to_command_line_arg_ENV_VAR_SOURCE_KEYanyrNrr_open_config_filesreversedrrr!r$rVhasattrrr"rrt4get_command_line_key_for_unknown_config_file_setting_CONFIG_FILE_SOURCE_KEYnargsOPTIONAL ZERO_OR_MORErSUPPRESS#ACTION_TYPES_THAT_DONT_NEED_A_VALUErf_DEFAULTS_SOURCE_KEYrr|r>openIOErrorr get_items_for_config_file_outputr#rFrexit)"rrwrxryrzZnormalized_argsargr,r.rZa_v_pairconfig_file_keysZstripped_config_file_keyZ env_var_argsZactions_with_env_var_valuesrZsupports_help_argZskip_config_file_parsingZknown_config_keysZconfig_streamsr Z config_itemsrOZ config_argsZdiscard_this_keyZ source_keyZdefault_settingsZcares_about_default_valueZ unknown_argsZ&user_write_out_config_file_arg_actionsZoutput_file_pathsZoutput_file_pathZ output_fileZ file_contentsr)rwrzrrr|s                               $    zArgumentParser.parse_known_argscCs"|j|j}|jdd|}|S)aCompute a commandline arg key to be used for a config file setting that doesn't correspond to any defined configargparse arg (and so doesn't have a user-specified commandline arg key). Args: key: The config file key that was being set. rr)r0r])rr,Zkey_without_prefix_charscommand_line_keyrrrrKs zCArgumentParser.get_command_line_key_for_unknown_config_file_settingc Cst}xv|jD]h\}}|tkr|d\}}xj|jD]`}|j|} | r8|j r8t||jr8t||j d} | dk r8t | t krt | j } | || d<q8Wq|tkrx|jD]<\} \}} |j|} | rt||j d} | dk r| || d<qWq|jtr$x||jD]\} \}} | || <qWq|tkrxN|jD]B\} \}} |j|} | r6t||j d} | dk r6| || d<q6WqW|S)aConverts the given settings back to a dictionary that can be passed to ConfigFormatParser.serialize(..). Args: source_to_settings: the dictionary described in parse_known_args() parsed_namespace: namespace object created within parse_known_args() Returns: an OrderedDict where keys are strings and values are either strings or lists rNr)rr"rrrrrrr>rfrAboolrElowerrr8rr) rZsource_to_settingsZparsed_namespaceZconfig_file_itemssourcesettingsrZexisting_command_line_argsrrr.r,rrrrXs@           z/ArgumentParser.get_items_for_config_file_outputcCsXg}|dkr|j|}n |jd }|dk rbt|tkrb|jd krN|j|n|jd||fnt|tkr|dkst|tj krx|D]}|j||jt |qWnlt|tj kr|j dkst|j t ko|j dkr|j|x.|D]}|jt |qWn|jd ||fn8t|t kr@|j||j|ntd t||f|S)aConverts a config file or env var key + value to a list of commandline args to append to the commandline. Args: action: The argparse Action object for this setting, or None if this config file setting doesn't correspond to any defined configargparse arg. key: string (config file key or env var name) value: parsed value of type string or list Nr4r-falseyesnozHUnexpected value for %s: '%s'. Expecting 'true', 'false', 'yes', or 'no'+*zp%s can't be set to a list '%s' unless its action type is changed to 'append' or nargs is set to '*', '+', or > 1z&Unexpected value type %s for value: %sr6)r-rrr)rr)rrrArrrrVrBr Z _AppendActionrE _StoreActionrintr )rrr,r.rwrZ list_elemrrrrs6           z/ArgumentParser.convert_item_to_command_line_argcsDg}x:|jD]0tfdd|jDr |ddg7}q W|S)zThis method decides which actions can be set in a config file and what their keys will be. It returns a list of 0 or more config keys that can be used to set the given action's value in a config file. csg|]}jd|qS)r)r8)r1c)rrrr3sz;ArgumentParser.get_possible_config_keys..rN)rrr])rrkeysr)rrrs  z'ArgumentParser.get_possible_config_keysc Csddttjttjj|jD}dd|jD}|s:|Sx|D]}tj|j dd}|j |dd}t j |||_ |j|d}|sq@|\}} t||jd } | sq@tjj| } tjj| s|j d | |t| g7}q@W|S) ajTries to parse config file path(s) from within command_line_args. Returns a list of opened config files, including files specified on the commandline as well as any default_config_files specified in the constructor that are present on disk. Args: command_line_args: List of all args (already split on spaces) cSsg|]}|D] }t|q qSr)r)r1filesfrrrr3sz5ArgumentParser._open_config_files..cSsg|]}t|ddr|qS)rhF)r>)r1rrrrr3sF)r]r`cSsdS)Nr)rmessagerrr error_methodsz7ArgumentParser._open_config_files..error_method)rwNzFile not found: %s)rDglobospath expanduserrsrr rr]Z _add_actiontypes MethodTyperVr|r>rfisfiler) rZcommand_line_argsZ config_filesZuser_config_file_arg_actionsrZ arg_parserrZ parsed_argrxrZuser_config_filerrrrs. "     z!ArgumentParser._open_config_filescCstdtdtdtdi}t}x|jjD]\}}|jd}||dt|dd}|j |xp|jD]d\}\}}|r|j d |d |fqht |t kr|j d |qht |t krh|j d d j |qhWq&W|jS) zReturns a string with all args and settings and where they came from (eg. commandline, config file, enviroment variable or default) zCommand Line Args: zEnvironment Variables: zConfig File (%s): z Defaults: |rr4Nz %-19s%s :z %s r{)rrrrrrr"r=tuplerFrArErBrCrG)rZsource_key_to_display_value_maprHrrr,rr.rrr format_valuess"    zArgumentParser.format_valuescCs|j|jdS)zBPrints the format_values() string (to sys.stdout or another file).N)rFr)rfilerrr print_valuesszArgumentParser.print_valuescsd}d}d}jrԈj}djd}fddjD}ddjD}|r|sV|rd_d}|d ||ddf7}d jd d |D}|rd |}|s|r|dd j|ttd|g7}|djj7}j r6ddjD} xH| D]@\} } d| } | j sd| _ | | j kr| j | 7_ d}d_ qW|sB|rzdg} |rXdg| } |rhdg| } |ddj| 7}|rj pdd|_ t j jS)NrFrrcsBg|]:}|jD].}j|r|jdkp0|jp0|j r||fqqS)rg)rrrfrhrj)r1rr)rrrr3sz.ArgumentParser.format_help..cSsg|]}t|ddr|qS)rhF)r>)r1rrrrr3#sTzCArgs that start with '%s' (eg. %s) can also be set in a config filez or css|]}|jr|jdVqdS)rN)r)r1rrrrrc-sz-ArgumentParser.format_help..zspecified via z (%s).r{cSs"g|]}t|ddr|j|fqS)rN)r>r)r1rrrrr37sz [env var: %s]rTzconfig file valueszenvironment variableszT If an arg is specified in more than one place, then commandline values override %s.z which override )rkrsr]rrCrBfilterrrrrlrgrYr r format_help)rr&Zadded_config_file_helpZadded_env_var_helprvZccZconfig_settable_argsZconfig_path_actionsZconfig_arg_stringZenv_var_actionsrrZenv_var_help_stringZ value_sourcesr)rrrsX         zArgumentParser.format_help)rrrrr HelpFormatterr%rqrenvironr~r|rrrrrrrostdoutrrrrrrrsL Z3 ./ 7rcOs|jdd}|jddp"|jdd}|jdd}|j||}|j |_||_||_||_|jrj|rjtd|jrt|t j krtd|jrd}t|t j krt|d |rt|d |S) a  This method supports the same args as ArgumentParser.add_argument(..) as well as the additional args below. Additional Args: env_var: If set, the value of this environment variable will override any config file or default values for this arg (but can itself be overriden on the commandline). Also, if auto_env_var_prefix is set in the constructor, this env var name will be used instead of the automatic name. is_config_file_arg: If True, this arg is treated as a config file path This provides an alternative way to specify config files in place of the ArgumentParser(fromfile_prefix_chars=..) mechanism. Default: False is_write_out_config_file_arg: If True, this arg will be treated as a config file path, and, when it is specified, will cause configargparse to write all current commandline args to this file as config options and then exit. Default: False rNrhZis_config_filerjz*env_var can't be set for a positional arg.z9arg with is_config_file_arg=True must have action='store'z+arg with is_write_out_config_file_arg=True zmust have action='store'z'can't also have is_config_file_arg=True) poporiginal_add_argument_methodrrrrhrjr rAr r)rrwrrrhrjrZ error_prefixrrrruQs,       rucstfdd|DS)zsUtility method for checking if any of the potential_command_line_args is already present in existing_args. c3s|]}|kVqdS)Nr)r1Z potential_arg)existing_args_listrrrcsz*already_on_command_line..)r)rZpotential_command_line_argsr)rrrs r)rr)rr)N)N)Er rrr9rorrpiorZ ordereddictr collectionssetZ_StoreTrueActionZ_StoreFalseActionZ _CountActionZ_StoreConstActionZ_AppendConstActionrr rrrZRawTextHelpFormatterZRawDescriptionHelpFormatterrobjectrrMr$r%rIrrrrrrurZ_ActionsContainerrrZ ArgumentErrorZArgumentTypeErrorZActionZFileTypeZ NamespaceZ ONE_OR_MORErZ REMAINDERrrZinitArgumentParserZgetArgumentParserZ getArgParserZ getParserZget_arg_parserZ get_parserZ ArgParserZParserZadd_argaddr~r!r|Z parse_knownZ RawFormatterZDefaultsFormatterZDefaultsRawFormatterrrrrs       (Q?N6