K idZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddlmZmZmZmZmZmZmZddlmZmZmZGdd eZGd d eZGd d eZGddeZGddZeZ GddejBZ!dd;Z=y)?zA simple configuration system.) annotationsN)Logger)Any ContainerDict HasTraitsList TraitType Undefined) cast_unicodefilefindwarningsc eZdZy) ConfigErrorN__name__ __module__ __qualname__]/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/traitlets/config/loader.pyrrrrc eZdZy)ConfigLoaderErrorNrrrrrrrrrc eZdZy)ConfigFileNotFoundNrrrrrr"rrrc eZdZy) ArgumentErrorNrrrrrr&rrrceZdZddZddZy) _Sentinelcy)Nzrselfs r__repr__z_Sentinel.__repr__6s&rcy)Nz rr#s r__str__z_Sentinel.__str__9srNreturnstr)rrrr%r'rrrr!r!5s 'rr!cpeZdZdZddfd Zej jje_xZS)ArgumentParserz?Simple argparse subclass that prints help to stdout by default.cF|tj}t| |SN)sysstdoutsuper print_help)r$file __class__s rr2zArgumentParser.print_helpCs! <::Dw!$''rr.)r3t.Anyr)None)rrr__doc__r2argparser, __classcell__r4s@rr,r,@s*I( "00;;CCJrr,ct|d5}tt|j|d||dddy#1swYyxYw)Nrbexec)openr=compileread)fnameglobfs rexecfilerDPs> eT ;a WQVVXuf -tT:;;;s '=AceZdZUdZdZeZded<eZded<eZ ded<ddZ ddZ dd Z dd Z dd ZeZdd Zdd ZddZddZddZy)LazyConfigValueaProxy object for exposing methods on configurable containers These methods allow appending/extending/updating to add to non-empty defaults instead of clobbering them. Exposes: - append, extend, insert on lists - update on dicts - update, add on sets Nz List[t.Any]_extend_prepend_insertsc:|jj|y)zAppend an item to a ListN)rGappendr$objs rrKzLazyConfigValue.appendis C rc:|jj|y)z Extend a listN)rGextendr$others rrOzLazyConfigValue.extendms E"rc"||jddy)z#like list.extend, but for the frontNr)rHrPs rprependzLazyConfigValue.prependqs! bqrct|tr|jj|j|j|_|jj|j|j j|j |j |_|j r,|j|j |j |_|S|j|S)a Merge with another earlier LazyConfigValue or an earlier container. This is useful when having global system-wide configuration files. Self is expected to have higher precedence. Parameters ---------- other : LazyConfigValue or container Returns ------- LazyConfigValue if ``other`` is also lazy, a reified container otherwise. ) isinstancerFrGrOrHrI_updateupdate get_valuerPs r merge_intozLazyConfigValue.merge_intous e_ - MM  . ==DL MM  0 NN ! !$-- 0!NNDM|| T\\*$}} K>>%( (rctt|ts td|jj ||fy)NzAn integer is required)rUint TypeErrorrIrK)r$indexrQs rinsertzLazyConfigValue.inserts.%%45 5 eU^,rc|j't|tri|_nt|_|jj |y)zUpdate either a set or dictN)rVrUdictsetrWrPs rrWzLazyConfigValue.updates8 << %&! "u  E"rc(|j|hy)zAdd an item to a setN)rWrLs raddzLazyConfigValue.adds SErc|j |jStj|}t|trQ|j D]\}}|j |||j|dd|j|jnot|tr(|jrS|j|jn7t|tr'|jr|j|j||_|S)znconstruct the value from the initial one after applying any insert / extend / update changes Nr)_valuecopydeepcopyrUlistrIr^rHrOrGr`rVrWra)r$initialvalueidxrMs rrXzLazyConfigValue.get_values ;; ";;  g& eT " MM 'S S#& ' E"1I LL & t $|| T\\* s #|| T\\*  rci}|jr|j|d<|jr|j|d<|jr|j|d<|S|jr|j|d<|S)zreturn JSONable dict form of my data Currently update as dict or set, extend, prepend as lists, and inserts as list of tuples. rWrOrSinserts)rVrGrHrI)r$ds rto_dictzLazyConfigValue.to_dictsg  <<,,AhK <<,,AhK ====AiL]]==AiLrc|j'd|jjd|jdSd|jjd|jdS)N )rer4rror#s rr%zLazyConfigValue.__repr__sW ;; "t~~../wt{{oQG Gt~~../q0B!D Dr)rMr5r)r6rQr5r)r6)rQr5r)r5)r]r[rQr5r)r6)rir5r)r5r)dict[str, t.Any]r()rrrr7rer rG__annotations__rHrIrKrOrSrYr^rrVrWrcrXror%rrrrFrFUsq F 6G[! FHk" FHk"!#")B-eG#. ErrFcvt|xr-|dj|dk(xr|jd S)z>Is a Config key a section name (does it start with a capital)?r_)boolupper startswithkeys r_is_section_keyrs6 LA #a&0L9L5L MMrceZdZdZddZddZddZddZddZdfd Z e Z ddZ dd Z dd Z dd Zdd Zdd ZddZddZddZxZS)ConfigaAn attribute-based dict that can do smart merges. Accessing a field on a config object for the first time populates the key with either a nested Config object for keys starting with capitals or :class:`.LazyConfigValue` for lowercase keys, allowing quick assignments such as:: c = Config() c.Class.int_trait = 5 c.Class.list_trait.append("x") cVtj|g|i||jyr.)r`__init___ensure_subconfig)r$argskwdss rrzConfig.__init__s$ d*T*T*  rc|D]K}||}t|st|ts%t|tr6t ||t|My)zensure that sub-dicts that should be Config objects are casts dicts that are under section keys to Config objects, which is necessary for constructing Config objects from dict literals. N)rrUr`rsetattr)r$r~rMs rrzConfig._ensure_subconfigsH  0Cs)Cs# 3(=jQTV\F]c6#;/ 0rc&|j|y)z$deprecated alias, use Config.merge()N)mergerPs r_mergez Config._merges 5rc8i}|jD]t\}}||vr|||<t|tr(t||tr||j|Ht|tr|j ||||<p|||<v|j |y)z)merge another config object into this oneN)itemsrUrrrFrYrW)r$rQ to_updatekvs rrz Config.merges KKM %DAq} ! a(ZQ-HGMM!$?3ll473DG$%IaL % Irci}|D]N}||vr||}||}|D]8}||vs||||k7s|j|i||d|||||<:P|S)zCheck for collisions between two config objects. Returns a dict of the form {"Class": {"trait": "collision message"}}`, indicating which values have been ignored. An empty dict indicates no collisions. z ignored, using ) setdefault)r$rQ collisionssectionminetheirsr~s rrzConfig.collisionss(*  _Ge#=D7^F _&=T#Y&+%=))'2626s)>NvVY{o/^Jw', _  _rcld|vr!|jdd\}}||vry|||vSt| |S)N.F)splitr1 __contains__)r$r~first remainderr4s rrzConfig.__contains__'sI #:"yya0 E9D U + +w#C((rc$t|xr||vSr.)rr$r~s r _has_sectionzConfig._has_section4ss#3t 3rcJt|tj|Sr.)typer`rfr#s rrfz Config.copy7stDz$))D/**rc"|jSr.)rfr#s r__copy__zConfig.__copy__:syy{rc&t|}|jD]m\}}t|ttfrt j ||}n6t|tttthvrt j |}|||<o|Sr.) rrrUrrFrfrgr`rhratuple)r$memo new_configr~rjs r __deepcopy__zConfig.__deepcopy__=s{T$Z\ **, $JC%&/!:; eT2etS% 88 %(#JsO $rc tj||S#t$rht|r%t }tj ||||cYS|j ds%t}tj ||||cYSwxYw)Nry)r` __getitem__KeyErrorrr __setitem__r|rF)r$r~crs rrzConfig.__getitem__Is} ##D#. . s#H  sA.^^C(#%  sA. s7B 4B B ct|r!t|tstd|d|tj |||y)NzIvalues whose keys begin with an uppercase char must be Config instances: , )rrUr ValueErrorr`r)r$r~rjs rrzConfig.__setitem__YsK 3 eV, 669WBuiI sE*rc|jdrtj||S |j|S#t$r}t ||d}~wwxYwN__)r|r` __getattr__rrAttributeErrorr$r~es rrzConfig.__getattr__bsT >>$ ##D#. . +##C( ( + # * +s: A AAc|jdrtj|||S |j||y#t$r}t ||d}~wwxYwr)r|r` __setattr__rrr)r$r~rjrs rrzConfig.__setattr__jsU >>$ ##D#u5 5 +   S% ( + # * +s= A AAc|jdrtj||S tj||y#t$r}t ||d}~wwxYwr)r|r` __delattr__ __delitem__rrrs rrzConfig.__delattr__rsS >>$ ##D#. . +   T3 ' + # * +sA A AA)rr5rr5r)r6r)r6rt)rQrr)rvr~r5r)rzr~r*r)rzru)rr5r)rr~r*r)r5)r~r*rjr5r)r6r~r*r)r6)rrrr7rrrrrrhas_keyrrfrrrrrrrr9r:s@rrrsZ ! 0$()G4+  ++++rrc,eZdZdZddZdfd ZxZS)DeferredConfigz0Class for deferred-evaluation of config from CLIctd)NzImplement in subclassesNotImplementedError)r$traits rrXzDeferredConfig.get_value~s!";<+?qAArNrr(rrrr7rXr%rrrrrs" Brrc eZdZdZddZddZy)DeferredConfigListaConfig value for loading config from a list of strings Interpretation is deferred until it is loaded into the trait. This class is only used for values that are not listed in the configurable classes. When config is loaded, `trait.from_string_list` will be used. If an error is raised in `.from_string_list`, the original string list is returned. .. versionadded:: 5.0 c t|drt|}|j}nNt|dkDr/t |j dt|dt||d}|j } ||S#t$r|cYSwxYw)rfrom_string_listrz only accepts one value, got z: r)hasattrrhrlenrnamerr)r$rsrccasts rrXzDeferredConfigList.get_values 5, -t*C))D4y1} zzl"?D {"TRVZLYq'C$$D 9  J  s4A<< B  B cV|jjd|jdSrrr#s rr%zDeferredConfigList.__repr__rrNrr(rrrrrrs ,Brrc2eZdZdZddZdd dZd dZd dZy) ConfigLoadera1A object for loading configurations from just about anywhere. The resulting configuration is packaged as a :class:`Config`. Notes ----- A :class:`ConfigLoader` does one thing: load a config from a source (file, command line arguments) and returns the data as a :class:`Config` object. There are lots of things that :class:`ConfigLoader` does not do. It does not implement complex logic for finding config files. It does not handle default values or merge multiple configs. These things need to be handled elsewhere. cLddlm}tjt|S)Nr) get_logger) traitlets.logrtrr)r$rs r _log_defaultzConfigLoader._log_defaults,vvfjl++rNc|j|1|j|_|jjdy||_y)aeA base class for config loaders. log : instance of :class:`logging.Logger` to use. By default logger of :meth:`traitlets.config.application.Application.instance()` will be used Examples -------- >>> cl = ConfigLoader() >>> config = cl.load_config() >>> config {} NzUsing default logger)clearrlogdebug)r$rs rrzConfigLoader.__init__s: ;((*DH HHNN1 2DHrc"t|_yr.)rconfigr#s rrzConfigLoader.clears h rc:|j|jS)aLoad a config from somewhere, return a :class:`Config` instance. Usually, this will cause self.config to be set and then returned. However, in most cases, :meth:`ConfigLoader.clear` should be called to erase any previous state. )rrr#s r load_configzConfigLoader.load_configs {{r)r)rr.)rz Logger | Noner)r6rr)r)rrrr7rrrrrrrrrs , *rrc.eZdZdZddfd ZddZxZS)FileConfigLoaderzA base class for file based configurations. As we add more file based config loaders, the common logic should go here. c Nt|di|||_||_d|_y)a.Build a config loader for a filename and path. Parameters ---------- filename : str The file name of the config file. path : str, list, tuple The path to search for the config file on, or a sequence of paths to try in order. Nr)r1rfilenamepath full_filename)r$rrkwr4s rrzFileConfigLoader.__init__s+ 2   rcNt|j|j|_y)z,Try to find the file by searching the paths.N)rrrrr#s r _find_filezFileConfigLoader._find_file$s%dmmTYY?rr.)rr*r str | Nonerr5r)r6r)rrrr7rrr9r:s@rrr s  @rrc8eZdZdZddZd dZd dZddZd dZy) JSONFileConfigLoaderaA JSON file loader for config Can also act as a context manager that rewrite the configuration file to disk on exit. Example:: with JSONFileConfigLoader('myapp.json','/home/jupyter/configurations/') as c: c.MyNewConfigurable.new_value = 'Updated' c|j |j|j }|j ||_|jS#t$r}tt ||d}~wwxYwz=Load the config from a file and return it as a Config object.N)rrOSErrorrr*_read_file_as_dict_convert_to_configr)r$rdcts rrz JSONFileConfigLoader.load_config5si  4 OO %%'--c2 {{  4$SV,! 3 4sA A7A22A7ct|j5}tjdt j |cdddS#1swYyxYw)Nrv)r>rrrjsonload)r$rCs rrz'JSONFileConfigLoader._read_file_as_dict@s> $$$ % <66,diil; < < rwrite)r$exc_type exc_value traceback json_configrCs r__exit__zJSONFileConfigLoader.__exit__SsW  jjQ7 $$$c * !a GGK  ! ! !s A$$A-Nrru)rrvr)r)robjectrrrrr)r6) rrrr7rrrrrrrrrr)s!  < P !rrc*eZdZdZddZdddZd dZy) PyFileConfigLoaderzA config loader for pure python files. This is responsible for locating a Python config file by filename and path, then executing it to construct a Config object. c|j |j|j |j S#t$r}tt ||d}~wwxYwr)rrrrr*rr)r$rs rrzPyFileConfigLoader.load_configgsU  4 OO  !{{ 4$SV,! 3 4s> A!AA!Nc| |j}|j||} |j}|jj |y#t $rYywxYw)z5Injected into config file namespace as load_subconfigN)rr4rrrr)r$rArloader sub_configs rload_subconfigz!PyFileConfigLoader.load_subconfigqs] <99Dt, *++-J KK  j ) "   sA AAcdfd }tjj|j}j}t |d5}t t |j|d||dddy#1swYyxYw)z>Load the config file into self.config, with recursive loading.cjS)zKUnnecessary now, but a deprecation warning is more trouble than it's worth.rr#sr get_configz9PyFileConfigLoader._read_file_as_dict..get_configs ;; r)rr"r&__file__r<r=Nr)r`rr"rr>r=r?r@)r$r& namespace conf_filenamerCs` rrz%PyFileConfigLoader._read_file_as_dicts} kk..!''  ** - & Q! =&99i P Q Q Qs 'A==Brr.)rAr*rrr)r6r)rrrr7rr"rrrrrr`s  *Qrrc2eZdZdZ d ddZddZy)CommandLineConfigLoaderzA config loader for command line arguments. As we add more command line based loaders, the common logic should go here. Nc|}t|tr^|r|j|}nit|trYt |dk(rKt t jj|d}n|r|j|}n t |}|jd^}}|j}|D]}||} |||<y)zexecute self.config. = * expands ~ with expanduser * interprets value with trait if available rrrN) rUrrXrrrosr expanduserrrr) r$lhsrhsrrjrr~rparts r_exec_config_strz(CommandLineConfigLoader._exec_config_strs e^ ,.C!34SQ,RWW-?-?A-GH))%0,U3YYs^ s++ $DdmG $ rct|ttfr7|jD]#\}}|j|j |%yt d|z)z=update self.config from a flag, which can be a dict or ConfigzInvalid flag: %rN)rUr`rrrrWr\)r$cfgsecrs r _load_flagz"CommandLineConfigLoader._load_flagsU cD&> *))+ +Q C ''* +.45 5rr.)r/r5r0r5rzTraitType[t.Any, t.Any] | Noner)r6)r4r5r)r6)rrrr7r2r6rrrr+r+s8OS$-K :6rr+z^\-?\-[A-Za-z][\w]*(\.[\w]+)*$__DOT____DASH__c.eZdZdZ d ddZy) _KVActionzDCustom argparse action for handling --Class.trait=x Always Nct|tr|g}|Dcgc]}|turdn|}}t||jd}| t }n t |}|j |t||j|ycc}w)N-)rUr*_DASH_REPLACEMENTgetattrdestrrOr)r$parserr(values option_stringrrs r__call__z_KVAction.__call__s fc "XF@FG1//#Q6GG 499d3 =&(E&u-E V 499e,HsBr.) r@zargparse.ArgumentParserr(rvrAzt.Sequence[t.Any]rBrr)r6)rrrr7rCrrrr:r:sA%) -'-$-" - " -  -rr:cBeZdZdZddZdfd Zdfd Zd d dZxZS) _DefaultOptionDictz_Like the default options dict but acts as if all --Class.trait options are predefined ct|g|jdjdt|jd||<y)Nr<r)option_stringsr?metavar)r:lstripreplace_DOT_REPLACEMENTrs r_add_kv_actionz!_DefaultOptionDict._add_kv_actions95C((.>?JJsO  S rcd|vryt||ry|jdr'tj |r|j |yy)N=FTr<)r1rr|class_trait_opt_patternmatchrLr$r~r4s rrz_DefaultOptionDict.__contains__sK #: 7  $ >># #:#@#@#E    $rc@||vrt||St|r.)r1rrrQs rrz_DefaultOptionDict.__getitem__s$ $;7&s+ +3- rc0 ||S#t$r|cYSwxYwr.)r)r$r~defaults rgetz_DefaultOptionDict.gets% 9  N s  rrrr.)r~r*rTr5r)r5) rrrr7rLrrrUr9r:s@rrErEs!    rrEc2eZdZdZ d dfd ZxZS) _KVArgParserzOsubclass of ArgumentParser where any --Class.trait option is implicitly definedc~||jfD]}t|j|_t|||Sr.) _optionalsrE_option_string_actionsr1parse_known_args)r$rr( containerr4s rr[z_KVArgParser.parse_known_argssD 0 dI/A)BbBb/cI , dw'i88r)NN)rzt.Sequence[str] | Noner(zargparse.Namespace | Noner)z+tuple[argparse.Namespace | None, list[str]])rrrr7r[r9r:s@rrWrW s/Y[_9*9>W9 499rrWceZdZdZeZ d d fd Zddedf d dZddZ ddZ ddZ ddZ dd Z dd ZxZS)ArgParseConfigLoaderzEA loader that uses the argparse module to load from the command line.Ncz|xsg}tt| ||j|tj dd}||_|xsi|_|xsi|_||_||_ ||_ |jdd|_ ttj} | j!|| |_y)a>Create a config loader for use with argparse. Parameters ---------- classes : optional, list The classes to scan for *container* config-traits and decide for their "multiplicity" when adding them as *argparse* arguments. argv : optional, list If given, used to read command-line arguments from, otherwise sys.argv[1:] is used. *parser_args : tuple A tuple of positional arguments that will be passed to the constructor of :class:`argparse.ArgumentParser`. **parser_kw : dict A tuple of keyword arguments that will be passed to the constructor of :class:`argparse.ArgumentParser`. aliases : dict of str to str Dict of aliases to full traitlets names for CLI parsing flags : dict of str to str Dict of flags to full traitlets names for CLI parsing log Passed to `ConfigLoader` Returns ------- config : Config The resulting Config object. )rNrr )argument_default)r1r+rrr/argvaliasesflagsclasses subcommands parser_argsr r r`r8SUPPRESSrW parser_kw) r$rarbrcrrdrerfrhkwargsr4s rrzArgParseConfigLoader.__init__"sN-R %t5#5> <88ABself.parsed_datar--r<c|dk(rtSjD];\}}||k(r|cS|j|dzs$|dz|t|dzdzcS|S)Nr<rNr)r=rr|r)argrrunpacked_aliasess r_replacez2ArgParseConfigLoader._parse_args.._replacesmcz(((..0 71!8H>>!c'*s7SQ!%666  7 JrN)rr*r)r*) r rbrrcrUrrr]r@ parse_args parsed_datart) r$rauargsalias alias_targetalrrkrtto_parsers @rrrz ArgParseConfigLoader._parse_argss6*./Qa//+- <<! '+||'9'9'; F#|DJJ&!%/"HEFB2w!|59L5H(r2262E$TBY/F  F  5=++d#CsQwy)JTc{HJH)12AHQK22;;11(;$G0@3s D Dct|jjD]>\}}|jd^}}|j}|D]}||} t |||@y)zself.parsed_data->self.configrN)varsrrrrr)r$rrrr~rps rrz'ArgParseConfigLoader._convert_to_configsg))*002 %DAqJT3kkG %!!* % GS! $  %r)NNNNNN)ralist[str] | Nonerbdict[str, str] | Nonercrrr5rdzlist[type[t.Any]] | NonereSubcommandsDict | Nonerfr5rhr5r)r6) rarrbr5rcr5rdr5r)r)r) list[str]rrbr5rcr5rdr5r)r6rdz list[t.Any]rerr)r6)rr5r)r5)rrrr7r,rwrrmrrurprxrqrrrr9r:s@rr^r^sO!L"&)-'+,0.26 6 '6 % 6  6 * 6 ,6 6 6  6 t"&" ''' '  '  'R DNV%%N%rr^cBeZdZdZdfd Z d ddZxZS) _FlagActionz ArgParse action to handle a flagc|jd|_|jdd|_t|d<|jsd|d<t ||i|y)Nflagrconstrnargs)r rrr r1rr$rrir4s rrz_FlagAction.__init__sPJJv& ZZ. #wzzF7O $)&)rc|jdk(s|tur9t|dsg|_|jj |j yt ||j|y)Nr_flags)rr rrrKrrr)r$r@r(rArBs rrCz_FlagAction.__call__sP ::?f 19h/#%     # #DII . Itzz6 2rrr5rir5r)r6r.) r@r5r(r5rAr5rBrr)r6)rrrr7rrCr9r:s@rrrs?**[_33(-37<3MW3 3rrc4eZdZdZeZddZddZd dZd dZ y) KVArgParseConfigLoaderznA config loader that loads aliases and flags with argparse, as well as arbitrary --Class.trait value c i}|jj}|jjg|ddix|_}|D]}|j dj D]g\}} |j d|} dti} t| ttfr,| jjd d } | d k(r| | d <n| | d <| | f|| <i|j D][\} \}}t| ts| f} | D];}||vr ||||<t|d k(r d|zd|zfnd|zf} || t||d=]|j D]\} }t| ts| f} | D]}t|j!dt"|d} d}||vr]||\} }| j%|d | vr||vrt'd|d|d| jjdxs t)| dd}||vr(| j+d dt| d <||| d<|| d<t|d k(r d|zd|zfnd|zf} || i| }|t-j.|||_y)N)rrt*)rTr%rr multiplicityrKactionrrr<r})rrhelp)rr?rHz The alias `z*` for the 'append' sequence config-trait `z` cannot be also a flag!' argcompleter?rrr})r@ add_argument set_defaultsargparse_traits class_traitsrrr*rUrrmetadatarUrrrrJrKrWrr>r functoolspartial completer)r$rbrcrd alias_flagspaarcls traitnamerargname argparse_kwdsrkeysrjfhelpr~rrrs rrxz%KVArgParseConfigLoader._add_argumentss(* kk&&    + L$243 BC$'$4$4D$4$A$G$G$I B 5 \\N!I;7!' ei%67#(>>#5#5nh#OL#x/2> h/1= g.,1=+A( B B%*KKM G D.5%dE*w G'>05K -25c(a-c 4#:.dSj]T+EF  G G '}}* OD)dE*w& %--c3CD(! $ /"1)">#5#5n#E$~tJL +",,Wc:.9M(+,7 ,BM&)-6M'*25c(a-c 4#:.dSj]d4m4+'0'8'8$#(F$I&  * rc |j}t|jjD]\}}|dk(r$|Dcgc]}|tk(rdn|c}|z|_/|dk(r5|j t d}d|vr|j|d}t|tr t|}nt|tr t|}|jj|}|r|d} |j||||jj(D]}|j+|ycc}w#t $r:}t|t"r|j%}t'd|d|d ||d}~wwxYw) zJself.parsed_data->self.config, parse unrecognized extra args via KVLoader.rtr<rrNrzError loading argument rNr)rtrrrr=rJrK_handle_unrecognized_aliasrUrhrr*rrrUr2rrrrrr6)r$rtr/r0rrrsubcs rrz)KVArgParseConfigLoader._convert_to_config6sy__ T--.446 WHCl"QT"UA!/@*@3a#G"UXb"bh++.4C#~//4#t$(-C%*3/((,,S1Ea W%%c361 W@$$++ "D OOD ! "=#V. Wc>2//+C#&=cU!C51#$NOUVV  WsD.,D33 E6<5E11E6c<|jjd|y)zHandling for unrecognized alias arguments Probably a mistyped alias. By default just log a warning, but users can override this to raise an error instead, e.g. self.parser.error("Unrecognized alias: '%s'" % arg) z1Unrecognized alias: '%s', it will have no effect.N)rwarning)r$rs rrz1KVArgParseConfigLoader._handle_unrecognized_alias]s LcRrc  ddl}ddlm}|j }||_t |xsg|_||jfit|diy#t$rYywxYw)r{rNr)argcomplete_config_argcomplete_kwargs) argcomplete ImportErrorrrExtendedCompletionFinderconfig_classesrhrer@r>)r$rdrerrfinders rrqz#KVArgParseConfigLoader._argcompletefsf   )#<<> '!+"34t{{Ggd,A2FG   sA A"!A"Nrr)rr*r)r6r) rrrr7rWrwrxrrrqrrrrrs'  LOb%"NS Hrrc$eZdZdZdfd ZxZS)KeyValueConfigLoaderz@Deprecated in traitlets 5.0 Use KVArgParseConfigLoader c\tjdtdt||i|y)Nz[KeyValueConfigLoader is deprecated since Traitlets 5.0. Use KVArgParseConfigLoader instead.r rk)rrnror1rrs rrzKeyValueConfigLoader.__init__|s.  3   $)&)rr)rrrr7rr9r:s@rrrvs **rrct}|D]1}t||} |j}|j|3|S#t$rYAt $rwxYw)aLoad multiple Python config files, merging each of them in turn. Parameters ---------- config_files : list of str List of config files names to load and merge into the config. path : unicode The full path to the location of the config files. )r)rrrrrr) config_filesrrcfr  next_configs rload_pyconfig_filesrsmXF &#BT2 & ,,.K LL % & M "     sA A A)rAr*rBzdict[str, Any]r)r6r)rrrr*r)r)>r7 __future__rr8rfrr r-rer/typingrloggingrtraitlets.traitletsrrrrr r r utilsr rrrrrrrr!rmr,rDrFrr`rrr*rrrrrrr+r?rOrKr=Actionr:rErWSubcommandsDictr^rrrrrrrrs$#  [[[44 )      % k DX,,D ; CEiCELN X+TX+v66B3BB'B'B^44n@|@84!+4!n/Q)/Qd,6l,6j%"**%FG--2##L 98** 9&&aee$g%2g%T3(//3,VH1VHr *1 * r