Ë
    ý�pj×§  ã                  ó2  — d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	Z	ddl
ZddlmZmZ ddlmZ ddlmZ ddlmZ ddlmZ dd	lmZmZ dd
lmZmZmZmZmZm Z m!Z! ddl"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z, ddl-m.Z. ddl/m0Z0 ddl1m2Z2m3Z3 ddl4m5Z5 ddl6m7Z7 djq                  «       Z9djq                  «       Z: e;e	d«      sdge	_<        dZ=ej|                  j                  dd«      Z@e@jƒ                  «       dv rdZBn!e@jƒ                  «       dv rdZBn eCde@› d�«      ‚e	jˆ                  xr e	jˆ                  j‹                  d«      ZF ejŽ                  dej�                  d ej’                  f   ¬!«      ZJej–                  ej˜                  d"f   ZMeNeOej’                  f   ZPeQeO   dz  ZReQeSe      ZTd-d#„ZU G d$„ d%eV«      ZW G d&„ d'ej°                  «      ZY G d(„ d)e«      ZZeZj¶                  Z\eZjº                  Z^d.d/d*„Z_d0d+„Z`ead,k(  reZjÅ                  «        yy)1z,A base class for a configurable application.é    )ÚannotationsN)ÚOrderedDictÚdefaultdict)Úsuppress)Údeepcopy)Ú
dictConfig)Údedent)ÚConfigurableÚSingletonConfigurable)ÚArgumentErrorÚConfigÚConfigFileNotFoundÚDeferredConfigStringÚJSONFileConfigLoaderÚKVArgParseConfigLoaderÚPyFileConfigLoader)
ÚBoolÚDictÚEnumÚInstanceÚListÚ
TraitErrorÚUnicodeÚdefaultÚobserveÚobserve_compat)ÚBunch)Únested_update)ÚindentÚwrap_paragraphsé   )Úcast_unicode)Úimport_itemzÜ
The options below are convenience aliases to configurable class-options,
as listed in the "Equivalent to" description-line of the aliases.
To see all configurable class-options for some <cmd>, use:
    <cmd> --help-all
zþ
The command-line option below sets the respective configurable class-parameter:
    --Class.parameter=value
This line is evaluated in Python, so simple expressions are allowed.
For instance, to set `C.a=[0,1,2]`, you may type this:
    --C.a='range(3)'
ÚargvÚ zp
Subcommands are launched as `{app} cmd [args]`. For information on using
subcommand 'cmd', do: `{app} cmd -h`.
Ú-TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR>   Ú1ÚtrueT>   r%   Ú0ÚfalseFzgUnsupported value for environment variable: 'TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR' is set to 'z4' which is none of  {'0', '1', 'false', 'true', ''}.zpythonw.exeÚT.)Úboundzlogging.LoggerAdapter[t.Any]c                ót   ‡ — t        j                  ‰ «      dˆ fd„«       }t        j                  t        |«      S )a  Method decorator for catching invalid config (Trait/ArgumentErrors) during init.

    On a TraitError (generally caused by bad config), this will print the trait's
    message, and exit the app.

    For use on init methods, to prevent invoking excepthook on invalid input.
    c                óü   •— 	  ‰| g|¢­i |¤ŽS # t         t        f$ r]}| j                  j                  d|«       | j                  j	                  d| j
                  «       | j                  d«       Y d }~y d }~ww xY w)Nz0Bad config encountered during initialization: %szConfig at the time: %sé   )r   r   ÚlogÚfatalÚdebugÚconfigÚexit)ÚappÚargsÚkwargsÚeÚmethods       €úm/workspace/moltex-experiments/.pixi/envs/default/lib/python3.12/site-packages/traitlets/config/application.pyÚinnerz!catch_config_error.<locals>.innerr   si   ø€ ð	Ù˜#Ð/ Ò/¨Ñ/Ð/øÜœMÐ*ò 	Ø�G‰G�M‰MÐLÈaÔPØ�G‰G�M‰MÐ2°C·J±JÔ?Ø�H‰H�Q�K‰Kûð	ús   ƒ �A;žAA6Á6A;)r5   ÚApplicationr6   út.Anyr7   r=   Úreturnr=   )Ú	functoolsÚwrapsÚtÚcastr+   )r9   r;   s   ` r:   Úcatch_config_errorrC   i   s3   ø€ ô ‡_�_�VÓôó ðô �6‰6”!�UÓÐó    c                  ó   — e Zd Zy)ÚApplicationErrorN)Ú__name__Ú
__module__Ú__qualname__© rD   r:   rF   rF   ~   s   „ ØrD   rF   c                  ó@   ‡ — e Zd ZdZej
                  ZdZdˆ fd„Zˆ xZ	S )ÚLevelFormattera  Formatter with additional `highlevel` record

    This field is empty if log level is less than highlevel_limit,
    otherwise it is formatted with self.highlevel_format.

    Useful for adding 'WARNING' to warning messages,
    without adding 'INFO' to info, etc.
    z %(levelname)s |c                ó    •— |j                   | j                  k\  r| j                  |j                  z  |_        nd|_        t
        ‰| �  |«      S )Nr%   )ÚlevelnoÚhighlevel_limitÚhighlevel_formatÚ__dict__Ú	highlevelÚsuperÚformat)ÚselfÚrecordÚ	__class__s     €r:   rT   zLevelFormatter.format�   sC   ø€ Ø�>‰>˜T×1Ñ1Ò1Ø#×4Ñ4°v·±ÑFˆFÕà!ˆFÔÜ‰w‰~˜fÓ%Ð%rD   )rV   zlogging.LogRecordr>   Ústr)
rG   rH   rI   Ú__doc__ÚloggingÚWARNrO   rP   rT   Ú__classcell__©rW   s   @r:   rL   rL   ‚   s#   ø„ ñð —l‘l€OØ)Ð÷&ñ &rD   rL   c                  óþ  ‡ — e Zd ZU dZ ed«      Zded<    ed«      Zded<    ee«      Zded<    ee	«      Z	ded<    ee
«      Z
ded	<   eZeZ e«       Zded
<   g Zded<   	 dg	 	 	 dhd„Z ed«      Zded<    e«       Zded<    ee«      Z edej4                  d¬«      j7                  d¬«      ZeZ edd¬«      j7                  d¬«      Z edd¬«      j7                  d¬«      Z did„Z! e"ddd d!«      djd"„«       Z# e"d#d$¬%«      djd&„«       Z$dkd'„Z% e&d#«      dld(„«       Z' e(d)¬«      j7                  d¬«      Z)d*d+iZ*ded,<   d d ejV                  iid-fd d.diid/fd d0diid1fd2œZ,ded3<    e(«       Z-d4ed5<    e.d6d¬7«      Z/ e e«       «      Z0 e.e1d8i d9¬«      Z2 e«       Z3d:ed;<    ed<¬«      j7                  d¬«      Z4 ed=¬«      j7                  d¬«      Z5 e"d0«      djd>„«       Z6 e"d.«      djd?„«       Z7dmd@„Z8 e"dA«      e9djˆ fdB„«       «       Z:e;dgdndC„«       Z<dkdD„Z=dkdE„Z>dkdF„Z?dodG„Z@dkdH„ZAdodI„ZBdkdJ„ZCdodK„ZDdkdL„ZEdodM„ZFdpdN„ZGdqdrdO„ZHdqdpdP„ZIdsdQ„ZJdkdR„ZKdodS„ZLdkdT„ZMdodU„ZNdkdV„ZOe;dgdtdW„«       ZPdudX„ZQ	 	 	 	 	 	 	 	 	 	 dvdY„ZReSdqdwdZ„«       ZTeSdkd[„«       ZUe;dgdnd\„«       ZVeS	 	 dx	 	 	 	 	 	 	 	 	 dyd]„«       ZWeXdzd^„«       ZYe;	 dg	 	 	 	 	 d{d_„«       ZZe;dkd`„«       Z[	 dg	 	 	 dhda„Z\dgd|db„Z]dkdc„Z^d}d~dd„Z_dkde„Z`eSdgddf„«       Zaˆ xZbS )€r<   z8A singleton application with full configuration support.Úapplicationzstr | Unicode[str, str | bytes]ÚnamezThis is an application.ÚdescriptionÚoption_descriptionÚkeyvalue_descriptionÚsubcommand_descriptionÚexamplesÚClassesTypeÚclassesc              #  óÜ   K  — |€| j                   }t        «       }|D ]K  }t        |j                  «       «      D ]-  }t	        |t
        «      sŒ||vsŒ|j                  |«       |–— Œ/ ŒM y­w)a  Iterate through configurable classes, including configurable parents

        :param classes:
            The list of classes to iterate; if not set, uses :attr:`classes`.

        Children should always be after parents, and each class should only be
        yielded once.
        N)rg   ÚsetÚreversedÚmroÚ
issubclassr
   Úadd)rU   rg   ÚseenÚcÚparents        r:   Ú_classes_inc_parentsz Application._classes_inc_parents°   s^   è ø€ ð ˆ?Ø—l‘lˆGä‹uˆÛˆAä" 1§5¡5£7Ö+�Ü˜f¤lÕ3¸ÀtÒ9KØ—H‘H˜VÔ$Ø “Lñ ,ñ ùs   ‚A
A,ÁA,ÁA,z0.0Úversionzlist[str] | List[str]r$   )r   é
   é   é   é(   é2   ÚDEBUGÚINFOr[   ÚERRORÚCRITICALz#Set the log level by value or name.)Údefault_valueÚhelpT©r3   z%Y-%m-%d %H:%M:%SzXThe date format used by logging formatters for `logging.Formatter` ``datefmt`` parameter)r}   z#[%(name)s]%(highlevel)s %(message)szThe Logging format templateÚStrDictc                ó8  — ddddt        j                  | j                  «      ddœid| j                  j                  › d| j                  j
                  › �| j                  | j                  dœi| j                  j
                  ddgd	œid
dœ}t        r|d= |d= |S )a‡  Return the base logging configuration.

        The default is to log to stderr using a StreamHandler, if no default
        handler already exists.

        The log handler level starts at logging.WARN, but this can be adjusted
        by setting the ``log_level`` attribute.

        The ``logging_config`` trait is merged into this allowing for finer
        control of logging.

        r/   Úconsolezlogging.StreamHandlerzext://sys.stderr)ÚclassÚ	formatterÚlevelÚstreamÚ.)r‚   rT   Údatefmtrx   )r„   ÚhandlersF)rr   rˆ   Ú
formattersÚloggersÚdisable_existing_loggersrˆ   rŠ   )
rZ   ÚgetLevelNameÚ	log_levelÚ_log_formatter_clsrH   rG   Ú
log_formatÚlog_datefmtrW   Ú
IS_PYTHONW©rU   r3   s     r:   Úget_default_logging_configz&Application.get_default_logging_configâ   s¿   € ð àØ4Ø!*Ü$×1Ñ1°$·.±.ÓAØ0ñ	ðð à×2Ñ2×=Ñ=Ð>¸aÀ×@WÑ@W×@`Ñ@`Ð?aÐbà"Ÿo™oØ#×/Ñ/ñðð —‘×'Ñ'Ø$Ø!* ñ*ðð ).ñ3
ˆõ8 ð �zÐ"Ø�yÐ!àˆrD   r�   r�   r�   Úlogging_configc                ó¶   — | j                   }t        |t        «      r-t        j                  t
        t        t        |«      «      | _         | j                  «        y ©N)	r�   Ú
isinstancerX   rA   rB   ÚintÚgetattrrZ   Ú_configure_logging)rU   Úchanger�   s      r:   Ú_observe_logging_changez#Application._observe_logging_change  s<   € ð —N‘Nˆ	Ü�i¤Ô%ÜŸV™V¤C¬´¸)Ó)DÓEˆDŒNØ×ÑÕ!rD   r0   r   )Útypec                ó$   — | j                  «        y r–   )rš   ©rU   r›   s     r:   Ú_observe_logging_defaultz$Application._observe_logging_default  s   € à×ÑÕ!rD   c                ó|   — | j                  «       }t        || j                  xs i «       t        |«       d| _        y )NT)r“   r   r”   r   Ú_logging_configuredr’   s     r:   rš   zApplication._configure_logging   s5   € Ø×0Ñ0Ó2ˆÜ�f˜d×1Ñ1Ò7°RÔ8Ü�6Ôà#'ˆÕ rD   c                óÆ   — t        j                  | j                  j                  «      }d|_        |}|�,|j
                  r|S |j                  s	 |S |j                  }|�Œ,|S )z#Start logging for this application.F)rZ   Ú	getLoggerrW   rG   Ú	propagaterˆ   rp   )rU   r0   Ú_logs      r:   Ú_log_defaultzApplication._log_default'  se   € ô ×Ñ §¡× 7Ñ 7Ó8ˆØˆŒØˆØÐØ�}Š}Ø�
Ø—>’>Øàˆ
ð —;‘;ˆDð Ñð ˆ
rD   a!  
            Configure additional log handlers.

            The default stderr logs handler is configured by the
            log_level, log_datefmt and log_format settings.

            This configuration can be used to configure additional handlers
            (e.g. to output the log to a file) or for finer control over the
            default handlers.

            If provided this should be a logging configuration dictionary, for
            more information see:
            https://docs.python.org/3/library/logging.config.html#logging-config-dictschema

            This dictionary is merged with the base logging configuration which
            defines the following:

            * A logging formatter intended for interactive use called
              ``console``.
            * A logging handler that writes to stderr called
              ``console`` which uses the formatter ``console``.
            * A logger with the name of this application set to ``DEBUG``
              level.

            This example adds a new handler that writes to a file:

            .. code-block:: python

               c.Application.logging_config = {
                   "handlers": {
                       "file": {
                           "class": "logging.FileHandler",
                           "level": "DEBUG",
                           "filename": "<path/to/file>",
                       }
                   },
                   "loggers": {
                       "<application-name>": {
                           "level": "DEBUG",
                           # NOTE: if you don't list the default "console"
                           # handler here then it will be disabled
                           "handlers": ["console", "file"],
                       },
                   },
               }

        z	log-levelzApplication.log_levelÚaliasesz5Set log-level to debug, for the most verbose logging.Úshow_configz<Show the application's configuration (human-readable format)Úshow_config_jsonz2Show the application's configuration (json format))r2   zshow-configzshow-config-jsonÚflagsz#dict[str, t.Any] | Dict[str, t.Any]Úsubcommandsz(traitlets.config.application.Application)Ú
allow_nonerJ   zÁThe subset of our configuration that came from the command-line

        We re-load this configuration after loading config files,
        to ensure that it maintains highest priority.
        z	List[str]Ú_loaded_config_fileszAInstead of starting the Application, dump configuration to stdoutzKInstead of starting the Application, dump configuration to stdout (as JSON)c                ó&   — |j                   | _        y r–   )Únewr©   rŸ   s     r:   Ú_show_config_json_changedz%Application._show_config_json_changed®  s   € à!Ÿ:™:ˆÕrD   c                ób   — |j                   r#| j                  | _        | j                  | _        y y r–   )r°   ÚstartÚ_save_startÚstart_show_configrŸ   s     r:   Ú_show_config_changedz Application._show_config_changed²  s'   € à�:Š:Ø#Ÿz™zˆDÔØ×/Ñ/ˆD�Jð rD   c                ó  — t        j                  | fi |¤Ž | j                  }|| j                  vrT| j                  |j                  u r|g| j                  ¢| _        y | j                  j	                  d| j                  «       y y )Nr   )r   Ú__init__rW   rg   Úinsert)rU   r7   Úclss      r:   r¸   zApplication.__init__¸  sl   € Ü×&Ñ& tÑ6¨vÒ6ð �n‰nˆØ�d—l‘lÑ"Ø�|‰|˜sŸ{™{Ñ*à #Ð3 d§l¡lÐ3�•à—‘×#Ñ# A t§~¡~Õ6ð #rD   r3   c                óp   •— t         ‰| �  |«       | j                  j                  d|j                  «       y )NzConfig changed: %r)rS   Ú_config_changedr0   r2   r°   )rU   r›   rW   s     €r:   r¼   zApplication._config_changedÄ  s)   ø€ ô 	‰Ñ Ô'Ø�‰�‰Ð+¨V¯Z©ZÕ8rD   c                ó&   — | j                  |«       y)zMDo the basic steps to configure me.

        Override in subclasses.
        N)Úparse_command_line)rU   r$   s     r:   Ú
initializezApplication.initializeÊ  s   € ð 	×Ñ Õ%rD   c                óˆ   — | j                   �6t        | j                   t        «      sJ ‚| j                   j                  «       S y)zAStart the app mainloop.

        Override in subclasses.
        N)Úsubappr—   r<   r³   ©rU   s    r:   r³   zApplication.startÒ  s:   € ð
 �;‰;Ð"Ü˜dŸk™k¬;Ô7Ð7Ð7Ø—;‘;×$Ñ$Ó&Ð&ð #rD   c                óþ  — | j                   j                  «       }| j                  j                  «       D ]D  }|j                  |v sŒ||j                     }|j                  dd«       |j                  dd«       ŒF | j                  rLt        j                  |t        j                  ddt        ¬«       t        j                  j                  d«       y| j                  r4t        d«       | j                  D ]  }t        d	|z   «       Œ t        «        t        |«      D ]\  }||   }|sŒt        |«       t!        d
d¬«      }t        |«      D ],  }||   }	t        d|› dt#        j$                  |	fi |¤Ž› �«       Œ. Œ^ y)z,start function used when show_config is Truer©   Nrª   r/   T)r   Ú	sort_keysr   Ú
zLoaded config files:z  é   )r   Úcompactz  .z = )r3   ÚcopyrW   rk   rG   Úpoprª   ÚjsonÚdumpÚsysÚstdoutÚreprÚwriter®   ÚprintÚsortedÚdictÚpprintÚpformat)
rU   r3   rº   Ú
cls_configÚfÚ	classnameÚclass_configÚpformat_kwargsÚ	traitnameÚvalues
             r:   rµ   zApplication.start_show_configÛ  s;  € à—‘×!Ñ!Ó#ˆà—>‘>×%Ñ%Ö'ˆCØ�|‰|˜vÒ%Ø# C§L¡LÑ1�
Ø—‘˜}¨dÔ3Ø—‘Ð1°4Õ8ð	 (ð × Ò Ü�I‰I�fœcŸj™j°¸dÌDÕQä�J‰J×Ñ˜TÔ"Øà×$Ò$ÜÐ(Ô)Ø×.Ô.�Ü�d˜Q‘h•ð /äŒGä žˆIØ! )Ñ,ˆLÙØÜ�)ÔÜ&*°!¸TÔ&BˆNä# LÖ1�	Ø$ YÑ/�Ü˜˜I˜; c¬&¯.©.¸Ñ*QÀ.Ñ*QÐ)RÐSÕTñ 2ñ (rD   c                óT   — t        dj                  | j                  «       «      «       y)z"Print the alias parts of the help.rÅ   N)rÐ   ÚjoinÚemit_alias_helprÂ   s    r:   Úprint_alias_helpzApplication.print_alias_helpü  s   € äˆd�i‰i˜×,Ñ,Ó.Ó/Õ0rD   c              #  óH  K  — | j                   syi }| j                  D ]H  }|j                  «       dd D ]0  }t        j                  t
        t           |«      ||j                  <   Œ2 ŒJ | j                   j                  «       D ]ê  \  }}	 t        |t        «      r|\  }}nd}|j                  d«      dd \  }}|dz   |z   }||   }|j                  d¬«      |   }	|j                  |	|¬«      j                  «       }
t        |t        «      s|f}t        |t         ¬«      }d	j#                  d
„ |D «       «      }|
d   j%                  d|z   |«      |
d<   |
E d{  –—†  t'        d|› d�«      –— Œì y7 Œ# t(        $ r#}| j*                  j-                  d||«       ‚ d}~ww xY w­w)z+Yield the lines for alias part of the help.Néýÿÿÿr†   éþÿÿÿTr~   )Úhelptext©Úkeyú, c              3  óF   K  — | ]  }t        |«      d kD  rdnd|z  –— Œ y­w©r/   z--%sz-%sN©Úlen©Ú.0Úms     r:   Ú	<genexpr>z.Application.emit_alias_help.<locals>.<genexpr>  ó$   è ø€ Ð!WÑQVÈA¬S°«V°aªZ¡6¸UÀaÕ"GÑQVùó   ‚!r   ú--zEquivalent to: [--Ú]z7Failed collecting help-message for alias %r, due to: %s)r¨   rg   rk   rA   rB   r�   r
   rG   Úitemsr—   ÚtupleÚsplitÚclass_traitsÚclass_get_trait_helpÚ
splitlinesrÑ   rê   rÝ   Úreplacer   Ú	Exceptionr0   Úerror)rU   Ú	classdictrº   ro   ÚaliasÚlongnameÚfhelpr×   rÚ   ÚtraitÚfhelp_linesÚexs               r:   rÞ   zApplication.emit_alias_help   s—  è ø€ à�|Š|Øà35ˆ	Ø—<”<ˆCà—W‘W“Y˜s “^�Ü()¯©¬t´LÑ/AÀ1Ó(E�	˜!Ÿ*™*Ò%ñ $ð  ð  $Ÿ|™|×1Ñ1Ö3‰OˆE�8ðÜ˜h¬Ô.Ø&.‘O�H™eà �EØ'/§~¡~°cÓ':¸2¸3Ð'?Ñ$�	˜9Ø$ s™?¨YÑ6�Ø 	Ñ*�à×(Ñ(°Ð(Ó5°iÑ@�Ø!×6Ñ6°uÀuÐ6ÓM×XÑXÓZ�ä! %¬Ô/Ø"˜H�EÜ˜u¬#Ô.�ØŸ	™	Ñ!WÑQVÓ!WÓW�ð "-¨Q¡×!7Ñ!7¸¸x¹ÈÓ!O�˜A‘Ø&×&Ð&ÜÐ1°(°¸1Ð=Ó>Ó>ñ+  4ð( 'ùäò Ø—‘—‘ÐXÐZ_ÐacÔdØûðüs=   ‚BF"Â
CE3ÅE1ÅE3Å.F"Å1E3Å3	FÅ<FÆFÆF"c                óT   — t        dj                  | j                  «       «      «       y)z Print the flag part of the help.rÅ   N)rÐ   rÝ   Úemit_flag_helprÂ   s    r:   Úprint_flag_helpzApplication.print_flag_help&  s   € äˆd�i‰i˜×+Ñ+Ó-Ó.Õ/rD   c              #  ó  K  — | j                   sy| j                   j                  «       D ]¯  \  }\  }}	 t        |t        «      s|f}t	        |t
        ¬«      }dj                  d„ |D «       «      }|–— t        t        |j                  «       «      «      –— dj                  d„ |j                  «       D «       «      }d|› d�}t        t        |«      «      –— Œ± y# t        $ r#}| j                  j                  d	||«       ‚ d}~ww xY w­w)
z.Yield the lines for the flag part of the help.Nrä   ræ   c              3  óF   K  — | ]  }t        |«      d kD  rdnd|z  –— Œ y­wrè   ré   rë   s     r:   rî   z-Application.emit_flag_help.<locals>.<genexpr>4  rï   rð   Ú c              3  óh   K  — | ]*  \  }}|j                  «       D ]  \  }}d |› d|› d|› �–— Œ Œ, y­w)rñ   r†   Ú=N)ró   )rì   ÚclnameÚ
props_dictÚpropÚvals        r:   rî   z-Application.emit_flag_help.<locals>.<genexpr>7  sJ   è ø€ ð $á.9Ñ*˜ 
Ø%/×%5Ñ%5Ö%7™	˜˜cð ˜˜  $  q¨¨Ô.à%7ð /Ù.9ùs   ‚02zEquivalent to: [rò   z6Failed collecting help-message for flag %r, due to: %s)r«   ró   r—   rô   rÑ   rê   rÝ   r   r	   Ústriprú   r0   rû   )rU   r«   Úcfgrÿ   Úcfg_listÚcfg_txtr  s          r:   r  zApplication.emit_flag_help*  sí   è ø€ à�zŠzØà#'§:¡:×#3Ñ#3Ö#5ÑˆE‘<�C˜ðÜ! %¬Ô/Ø"˜H�EÜ˜u¬#Ô.�ØŸ	™	Ñ!WÑQVÓ!WÓW�Ø’ÜœV E§K¡K£MÓ2Ó3Ò3ØŸ8™8ñ $à.1¯i©i¬kó$ó �ð
 -¨X¨J°aÐ8�ÜœV G›_Ó-Ó-ñ $6øô ò Ø—‘—‘ÐWÐY^Ð`bÔcØûðüs)   ‚1D´B&CÃDÃ	D	Ã&DÄD	Ä	Dc                óT   — t        dj                  | j                  «       «      «       y)z#Print the options part of the help.rÅ   N)rÐ   rÝ   Úemit_options_helprÂ   s    r:   Úprint_optionszApplication.print_optionsB  s   € äˆd�i‰i˜×.Ñ.Ó0Ó1Õ2rD   c              #  ó  K  — | j                   s| j                  syd}|–— dt        |«      z  –— t        | j                  «      D ]
  }|–— d–— Œ | j                  «       E d{  –—†  | j                  «       E d{  –—†  d–— y7 Œ!7 Œ­w)z1Yield the lines for the options part of the help.NÚOptionsr
  r%   )r«   r¨   rê   r    rb   r  rÞ   )rU   ÚheaderÚps      r:   r  zApplication.emit_options_helpF  s‚   è ø€ à�zŠz $§,¢,ØØˆØŠØ”C˜“KÑÒÜ  ×!8Ñ!8Ö9ˆAØŠGØ‹Hð :ð ×&Ñ&Ó(×(Ð(Ø×'Ñ'Ó)×)Ð)Ø‹ð 	)øØ)ús$   ‚A%BÁ'B	Á(BÁ?BÂ 
BÂBc                óT   — t        dj                  | j                  «       «      «       y)z&Print the subcommand part of the help.rÅ   N)rÐ   rÝ   Úemit_subcommands_helprÂ   s    r:   Úprint_subcommandszApplication.print_subcommandsU  s   € äˆd�i‰i˜×2Ñ2Ó4Ó5Õ6rD   c              #  ór  K  — | j                   syd}|–— dt        |«      z  –— t        | j                  j	                  | j
                  ¬«      «      D ]
  }|–— d–— Œ | j                   j                  «       D ]3  \  }\  }}|–— |sŒt        t        |j                  «       «      «      –— Œ5 d–— y­w)z4Yield the lines for the subcommand part of the help.NÚSubcommandsr
  )r5   r%   )
r¬   rê   r    rd   rT   r`   ró   r   r	   r  )rU   r  r  ÚsubcÚ_r}   s         r:   r  z!Application.emit_subcommands_helpY  s¥   è ø€ à×ÒØàˆØŠØ”C˜“KÑÒÜ  ×!<Ñ!<×!CÑ!CÈÏ	É	Ð!CÓ!RÖSˆAØŠGØ‹Hð Tð  $×/Ñ/×5Ñ5Ö7‰OˆD‘)�1�dØŠJÚÜœV D§J¡J£LÓ1Ó2Ó2ð  8ð ‹ùs   ‚B	B7Â+B7c              #  ó"   K  — |s	d–— d–— yy­w)zzYield the very bottom lines of the help message.

        If classes=False (the default), print `--help-all` msg.
        z5To see all available configurables, use `--help-all`.r%   NrJ   ©rU   rg   s     r:   Úemit_help_epiloguezApplication.emit_help_epiloguej  s   è ø€ ñ
 ØIÒIØ‹Hð ùs   ‚c                óX   — t        dj                  | j                  |¬«      «      «       y)z‘Print the help for each Configurable class in self.classes.

        If classes=False (the default), only flags and aliases are printed.
        rÅ   ©rg   N)rÐ   rÝ   Ú	emit_helpr"  s     r:   Ú
print_helpzApplication.print_helps  s    € ô
 	ˆd�i‰i˜Ÿ™¨w˜Ó7Ó8Õ9rD   c              #  óÈ  K  — | j                  «       E d{  –—†  | j                  «       E d{  –—†  | j                  «       E d{  –—†  |rY| j                  «       }|�*d–— d–— t	        | j
                  «      D ]
  }|–— d–— Œ |D ]  }|j                  «       –— d–— Œ | j                  «       E d{  –—†  | j                  |«      E d{  –—†  y7 ŒÁ7 Œ«7 Œ•7 Œ$7 Œ­w)z—Yield the help-lines for each Configurable class in self.classes.

        If classes=False (the default), only flags and aliases are printed.
        NzClass optionsz=============r%   )	Úemit_descriptionr  r  Ú_classes_with_config_traitsr    rc   Úclass_get_helpÚemit_examplesr#  )rU   rg   Úhelp_classesr  rº   s        r:   r&  zApplication.emit_helpz  sà   è ø€ ð
 ×(Ñ(Ó*×*Ð*Ø×-Ñ-Ó/×/Ð/Ø×)Ñ)Ó+×+Ð+áØ×;Ñ;Ó=ˆLØÐ'Ø%Ò%Ø%Ò%Ü(¨×)BÑ)BÖC�AØ’GØ“Hð Dó $�Ø×(Ñ(Ó*Ò*Ø“ð $ð ×%Ñ%Ó'×'Ð'à×*Ñ*¨7Ó3×3Ñ3ð% 	+øØ/øØ+øð 	(øà3úsV   ‚C"–C—C"®C¯C"ÁCÁA2C"Â9CÂ:C"ÃC ÃC"ÃC"ÃC"ÃC"Ã C"c                óN   — dj                  d„ | j                  «       D «       «      S )zwGenerate rST format documentation for the config options this application

        Returns a multiline string.
        rÅ   c              3  ó<   K  — | ]  }|j                  «       –— Œ y ­wr–   )Úclass_config_rst_doc)rì   ro   s     r:   rî   z6Application.document_config_options.<locals>.<genexpr>˜  s   è ø€ ÐWÑ;V°a˜×/Ñ/×1Ñ;Vùs   ‚)rÝ   rq   rÂ   s    r:   Údocument_config_optionsz#Application.document_config_options“  s"   € ð
 �y‰yÑW¸4×;TÑ;TÔ;VÓWÓWÐWrD   c                óT   — t        dj                  | j                  «       «      «       y)z"Print the application description.rÅ   N)rÐ   rÝ   r)  rÂ   s    r:   Úprint_descriptionzApplication.print_descriptionš  s   € äˆd�i‰i˜×-Ñ-Ó/Ó0Õ1rD   c              #  ót   K  — t        | j                  xs | j                  xs d«      D ]
  }|–— d–— Œ y­w)z-Yield lines with the application description.r%   N)r    ra   rY   )rU   r  s     r:   r)  zApplication.emit_descriptionž  s4   è ø€ ä  ×!1Ñ!1Ò!G°T·\±\Ò!GÀRÖHˆAØŠGØ‹Hñ Iùs   ‚68c                óT   — t        dj                  | j                  «       «      «       y)z1Print usage and examples (see `emit_examples()`).rÅ   N)rÐ   rÝ   r,  rÂ   s    r:   Úprint_exampleszApplication.print_examples¤  s   € äˆd�i‰i˜×*Ñ*Ó,Ó-Õ.rD   c              #  ó¢   K  — | j                   r?d–— d–— d–— t        t        | j                   j                  «       «      «      –— d–— yy­w)z¼Yield lines with the usage and examples.

        This usage string goes at the end of the command line help string
        and should contain examples of the application's usage.
        ÚExamplesz--------r%   N)re   r   r	   r  rÂ   s    r:   r,  zApplication.emit_examples¨  sG   è ø€ ð �=Š=ØÒØÒØŠHÜœ §¡× 3Ñ 3Ó 5Ó6Ó7Ò7Ø‹Hð ùs   ‚AAc                ó.   — t        | j                  «       y)zPrint the version string.N)rÐ   rr   rÂ   s    r:   Úprint_versionzApplication.print_versionµ  s   € äˆd�l‰lÕrD   c                ó¬  — | j                   j                  |«      }|€J ‚|\  }}t        |t        «      rt	        |«      }t        |t
        «      rBt        |t        «      r2| j                  j                  «        |j                  | ¬«      | _        n(t        |«      r || «      | _        nt        d|› d�«      ‚| j                  j                  |«       y)z"Initialize a subcommand with argv.N)rp   z!Invalid mappings for subcommand 'z'!)r¬   Úgetr—   rX   r#   r�   rl   r<   rW   Úclear_instanceÚinstancerÁ   ÚcallableÚAssertionErrorr¿   )rU   r  r$   r  rÁ   r   s         r:   Úinitialize_subcommandz!Application.initialize_subcommand¹  s´   € ð ×Ñ×"Ñ" 4Ó(ˆØˆÐˆØ‰	ˆ�ä�fœcÔ"Ü  Ó(ˆFô �fœdÔ#¬
°6¼;Ô(Gà�N‰N×)Ñ)Ô+à Ÿ/™/°˜/Ó6ˆD�KÜ�fÔá  ›,ˆD�Kä Ð#DÀTÀFÈ"Ð!MÓNÐNð 	�‰×Ñ˜tÕ$rD   c                ó*  — t        t        «      }| j                  D ]D  }|j                  }|j	                  «       dd D ]   }||j                     j                  |«       Œ" ŒF i }| j                  j                  «       D ]w  \  }}t        |t        «      r|\  }}|j                  dd«      \  }}	||   }
t        |
«      dk(  r|
d   }t        |t        «      s|f}|D ]  }dj                  ||	g«      ||<   Œ Œy i }| j                  j                  «       D ]y  \  }\  }}i }|j                  «       D ];  \  }}||   }
t        |
«      dk(  r|
d   }||v r||   j                  |«       Œ7|||<   Œ= t        |t        «      s|f}|D ]	  }||f||<   Œ Œ{ ||fS )aä  Flatten flags and aliases for loaders, so cl-args override as expected.

        This prevents issues such as an alias pointing to InteractiveShell,
        but a config file setting the same trait in TerminalInteraciveShell
        getting inappropriate priority over the command-line arg.
        Also, loaders expect ``(key: longname)`` and not ``key: (longname, help)`` items.

        Only aliases with exactly one descendent in the class list
        will be promoted.

        r/   rá   r†   r   )r   Úlistrg   rG   rk   Úappendr¨   ró   r—   rô   rõ   rê   rÝ   r«   Úupdate)rU   Úmro_treerº   Úclsnamerp   r¨   rý   rþ   r   r   ÚchildrenÚalr«   rå   Úflagdictr}   ÚnewflagÚsubdictÚks                      r:   Úflatten_flagszApplication.flatten_flagsÒ  s¢  € ô œtÓ$ˆØ—<”<ˆCØ—l‘lˆGØŸ'™'›) A b›/�à˜Ÿ™Ñ)×0Ñ0°Õ9ñ *ð  ð #%ˆØ#Ÿ|™|×1Ñ1Ö3‰OˆE�8Ü˜(¤EÔ*Ø&‘�˜!Ø!Ÿ™¨¨QÓ/‰JˆC�Ø ‘}ˆHÜ�8‹} Ò!à˜q‘k�Ü˜e¤UÔ+Ø˜�Û�Ø!Ÿh™h¨¨U |Ó4�˜’ñ ð  4ð ˆØ%)§Z¡Z×%5Ñ%5Ö%7Ñ!ˆCÑ!�(˜DØ*,ˆGØ (§¡Ö 0‘��WØ# C™=�ä�x“= AÒ%Ø" 1™+�Cà˜'‘>Ø˜C‘L×'Ñ'¨Õ0à#*�G˜C’Lð !1ô ˜c¤5Ô)Ø�f�Û�Ø# T˜?��a’ñ ð &8ð" �gˆ~ÐrD   c                óL   — t        ||||| j                  | j                  ¬«      S )N)rg   r0   r¬   )r   r0   r¬   )rU   r$   r¨   r«   rg   s        r:   Ú_create_loaderzApplication._create_loader  s(   € ô &Ø�'˜5¨'°t·x±xÈT×M]ÑM]ô
ð 	
rD   c                óº   — |r&dt         j                  v r	 ddlm}  |«       }|€J ‚|S t        j                  S # t        t
        f$ r Y t        j                  S w xY w)a  Get `sys.argv` or equivalent from `argcomplete`

        `argcomplete`'s strategy is to call the python script with no arguments,
        so ``len(sys.argv) == 1``, and run until the `ArgumentParser` is constructed
        and determine what completions are available.

        On the other hand, `traitlet`'s subcommand-handling strategy is to check
        ``sys.argv[1]`` and see if it matches a subcommand, and if so then dynamically
        load the subcommand app and initialize it with ``sys.argv[1:]``.

        This helper method helps to take the current tokens for `argcomplete` and pass
        them through as `argv`.
        Ú_ARGCOMPLETEr   )Úget_argcomplete_cwords)ÚosÚenvironÚ#traitlets.config.argcomplete_configrS  ÚImportErrorÚModuleNotFoundErrorrÌ   r$   )rº   Úcheck_argcompleterS  Úcwordss       r:   Ú_get_sys_argvzApplication._get_sys_argv  sa   € ñ  ´2·:±:Ñ!=ðÝVá/Ó1�ØÐ)Ð)Ð)Ø�ô �x‰xˆøô  Ô!4Ð5ò ØÜ�x‰xˆðús   –9 ¹AÁAc                óp   — dt         j                  vry	 ddlm}  |«        y# t        t
        f$ r Y yw xY w)aß  Helper for `argcomplete` to recognize `traitlets` subcommands

        `argcomplete` does not know that `traitlets` has already consumed subcommands,
        as it only "sees" the final `argparse.ArgumentParser` that is constructed.
        (Indeed `KVArgParseConfigLoader` does not get passed subcommands at all currently.)
        We explicitly manipulate the environment variables used internally by `argcomplete`
        to get it to skip over the subcommand tokens.
        rR  Nr   )Úincrement_argcomplete_index)rT  rU  rV  r]  rW  rX  )rº   r]  s     r:   Ú"_handle_argcomplete_for_subcommandz.Application._handle_argcomplete_for_subcommand2  s9   € ð ¤§¡Ñ+Øð	ÝWá'Õ)øÜÔ0Ð1ò 	Ùð	ús   •# £5´5c                ó  ‡	— t        |t        «      rJ ‚|€(| j                  t        | j                  «      ¬«      dd }|D �cg c]  }t        |«      ‘Œ c}| _        |r|d   dk(  r	g |dd ¢d‘}| j                  r^t        |«      dkD  rP|d   |dd }}t        j                  d|«      r0|| j                  v r"| j                  «        | j                  ||«      S 	 |d|j                  d«       Š	t        ˆ	fd	„d
D «       «      r$| j                  d‰	v «       | j!                  d«       d‰	v sd‰	v r!| j#                  «        | j!                  d«       | j%                  «       \  }}t'        | j)                  «       «      }| j+                  ||||¬«      }	 t-        |j/                  «       «      | _        | j5                  | j0                  «       |j6                  | _        yc c}w # t        $ r |Š	Y �Œw xY w# t2        $ r ‚ w xY w)z!Parse the command line arguments.N)rY  r/   r   r}   ú-hz^\w(\-?\w)*$rñ   c              3  ó&   •K  — | ]  }|‰v –— Œ
 y ­wr–   rJ   )rì   ÚxÚinterpreted_argvs     €r:   rî   z1Application.parse_command_line.<locals>.<genexpr>c  s   øè ø€ ÐMÑ.L¨ˆqÐ$Ô$Ñ.Lùs   ƒ)r`  ú
--help-allz--helprd  z	--versionz-Vr%  )r—   rX   r[  Úboolr¬   r"   r$   rê   ÚreÚmatchr^  rA  ÚindexÚ
ValueErrorÚanyr'  r4   r:  rN  rC  r*  rP  r   Úload_configÚ
cli_configÚ
SystemExitÚupdate_configÚ
extra_args)
rU   r$   Úargr  Úsubargvr«   r¨   rg   Úloaderrc  s
            @r:   r¾   zApplication.parse_command_lineF  sþ  ø€ ô ˜d¤CÔ(Ð(Ð(Øˆ<Ø×%Ñ%¼¸T×=MÑ=MÓ8NÐ%ÓOÐPQÐPRÐSˆDÙ26Ó7±$¨3”\ #Õ&°$Ñ7ˆŒ	á�D˜‘G˜vÒ%à$�T˜!˜"�XÐ$˜tÐ$ˆDà×Ò¤ D£	¨A¢à  ™G T¨!¨" X�'ˆDÜ�x‰x˜¨Ô.°4¸4×;KÑ;KÑ3Kà×7Ñ7Ô9Ø×1Ñ1°$¸Ó@Ð@ð	$Ø#Ð$6 d§j¡j°Ó&6Ð7Ðô ÓMÑ.LÓMÔMØ�O‰O˜LÐ,<Ð<Ô=Ø�I‰I�aŒLàÐ*Ñ*¨dÐ6FÑ.FØ×ÑÔ Ø�I‰I�aŒLð ×+Ñ+Ó-‰ˆˆwÜ�t×7Ñ7Ó9Ó:ˆØ×$Ñ$ T¨7°EÀ7Ð$ÓKˆð	Ü& v×'9Ñ'9Ó';Ó<ˆDŒOð
 	×Ñ˜4Ÿ?™?Ô+à ×+Ñ+ˆ�ùòW 8øô( ò 	$Ø#Óð	$ûô" ò 	ð ð	ús$   ÁGÃG! ÆG3 Ç!G0Ç/G0Ç3G>c              #  ó¦  K  — t         j                  j                  |«      rdg}t        |t        «      s|€|g}t        |«      D �]E  }| j                  |dz   ||¬«      }|r)|j                  d||xs t        j                  «       «       | j                  |dz   ||¬«      }g }g }	||fD ]Þ  }
d}	 |
j                  «       }|r|j                  d|
j                  «       	 |sŒ8t        |	|d¬
«      D ]Z  \  }}|j!                  |«      }|sŒ|sŒ|j#                  d||
j                  |
j                  t%        j&                  |d¬«      «       Œ\ ||
j                  f–— |j)                  |«       |	j)                  |
j                  «       Œà �ŒH y# t        $ r Y Œ»t        $ r, |
j                  xs |}|r‚ |r|j                  d|d¬	«       Y Œîw xY w­w)zeLoad config files (py,json) by filename and path.

        yield each config object in turn.
        Nz.py)Úpathr0   zLooking for %s in %sz.jsonzLoaded config file: %sz&Exception while loading config file %sT)Úexc_info)ÚstrictzICollisions detected in %s and %s config files. %s has higher priority: %sr!   )r   )rT  rt  Úisabsr—   rX   rj   Úpython_config_loader_classr2   ÚgetcwdÚjson_config_loader_classrk  Úfull_filenamer   rú   rû   ÚzipÚ
collisionsÚwarningrÊ   ÚdumpsrD  )rº   Úbasefilenamert  r0   Úraise_config_file_errorsÚcurrentÚpyloaderÚ
jsonloaderÚloadedÚ	filenamesrr  r3   ÚfilenameÚearlier_configr}  s                  r:   Ú_load_config_fileszApplication._load_config_filesy  sÐ  è ø€ ô �7‰7�=‰=˜Ô&Ø�6ˆDÜ�dœCÔ  D LØ�6ˆDÜ —~ˆGà×5Ñ5°lÀUÑ6JÐQXÐ^aÐ5ÓbˆHÙØ—	‘	Ð0°,ÀÒ@VÌ2Ï9É9Ë;ÔWØ×5Ñ5°lÀWÑ6LÐSZÐ`cÐ5ÓdˆJØ"$ˆFØ#%ˆIØ# ZÓ0�Ø�ðRØ#×/Ñ/Ó1�Fñ ØŸ	™	Ð":¸F×<PÑ<PÕQÚÜ47¸	À6ÐRV×4WÑ0˜ .Ø%3×%>Ñ%>¸vÓ%F˜
Ú%ª#ØŸK™Kð!>à (Ø &× 4Ñ 4Ø &× 4Ñ 4Ü $§
¡
¨:¸aÔ @õð 5Xð " 6×#7Ñ#7Ð8Ò8Ø—M‘M &Ô)Ø×$Ñ$ V×%9Ñ%9Õ:òA 1ñ &øô *ò ÙÜ ò eð  &×3Ñ3ÒC°|�Há/ØÙØŸ	™	Ð"JÈHÐ_c˜	ÔdùðeüsI   ‚B-GÂ0FÃ !GÃ"'GÄ
GÄBGÆ	GÆGÆ1GÇGÇGÇGc                ó    — | j                   dd S )z$Currently loaded configuration filesN)r®   rÂ   s    r:   Úloaded_config_fileszApplication.loaded_config_files³  s   € ð ×(Ñ(©Ð+Ð+rD   c                óŒ  — t         j                  j                  |«      \  }}t        «       }| j	                  ||| j
                  | j                  ¬«      D ]@  \  }}|j                  |«       || j                  vsŒ&| j                  j                  |«       ŒB |j                  | j                  «       | j                  |«       y)z'Load config files by filename and path.)rt  r0   r�  N)rT  rt  Úsplitextr   r‰  r0   r�  Úmerger®   rD  rl  rn  )rU   r‡  rt  Ú_extÚ
new_configr3   Úfnames          r:   Úload_config_filezApplication.load_config_file¸  s«   € ô
 Ÿ™×)Ñ)¨(Ó3‰ˆ�$Ü“Xˆ
Ø!×4Ñ4ØØØ—‘Ø%)×%BÑ%Bð	 5ö 
‰MˆF�Eð ×Ñ˜VÔ$à˜T×6Ñ6Ò6à×)Ñ)×0Ñ0°Õ7ð
ð 	×Ñ˜Ÿ™Ô)Ø×Ñ˜:Õ&rD   c                ó  — | j                   j                  «       j                  dd«      }t        «       }| j                  j                  d|«       t        j                  j                  «       D ]m  \  }}|j                  |«      sŒ| j                  j                  d||«       |j                  d«      �^}}}|}|D ]  }	||	   }Œ	 t        ||t        |«      «       Œo |j                  | j                  «       | j                  |«       y)z!Load config files by environment.Ú-r   z1Looping through config variables with prefix "%s"zSeeing environ "%s"="%s"Ú__N)r`   Úupperrù   r   r0   r2   rT  rU  ró   Ú
startswithrõ   Úsetattrr   rŽ  rl  rn  )
rU   ÚPREFIXr�  rM  Úvr   rt  rå   Úsectionr  s
             r:   Úload_config_environzApplication.load_config_environÎ  sØ   € ð —‘—‘Ó"×*Ñ*¨3°Ó4ˆÜ“Xˆ
à�‰�‰ÐJÈFÔSä—J‘J×$Ñ$Ö&‰DˆAˆqØ�|‰|˜FÕ#Ø—‘—‘Ð9¸1¸aÔ@ð !"§¡¨£‘��D˜#Ø$�Û�AØ% a™j‘Gð ä˜ Ô&:¸1Ó&=Õ>ð 'ð 	×Ñ˜Ÿ™Ô)Ø×Ñ˜:Õ&rD   c              #  ó,  ‡‡K  — |€| j                   }t        d„ | j                  |«      D «       «      Šdˆfd„Š	 ‰j                  «       }t        ˆfd„‰j	                  «       D «       «      Š‰|k(  rnŒ9‰j	                  «       D ]  \  }}|sŒ	|–— Œ y­w)aË  
        Yields only classes with configurable traits, and their subclasses.

        :param classes:
            The list of classes to iterate; if not set, uses :attr:`classes`.

        Thus, produced sample config-file will contain all classes
        on which a trait-value may be overridden:

        - either on the class owning the trait,
        - or on its subclasses, even if those subclasses do not define
          any traits themselves.
        Nc              3  óV   K  — | ]!  }|t        |j                  d ¬«      «      f–— Œ# y­w)Tr~   N)re  Úclass_own_traits)rì   rº   s     r:   rî   z:Application._classes_with_config_traits.<locals>.<genexpr>÷  s0   è ø€ ð $
á9�ð ”$�s×+Ñ+°4Ð+Ó8Ó9Ô:Ù9ùs   ‚')c                ó@   •— t        ˆfd„| j                  D «       «      S )Nc              3  ó4   •K  — | ]  }|‰v xr ‰|   –— Œ y ­wr–   rJ   )rì   ÚbÚcls_to_configs     €r:   rî   zZApplication._classes_with_config_traits.<locals>.is_any_parent_included.<locals>.<genexpr>ý  s$   øè ø€ ÐVÉÀ1�q˜MÐ)Ò>¨m¸AÑ.>Ó>Éùs   ƒ)rj  Ú	__bases__)rº   r£  s    €r:   Úis_any_parent_includedzGApplication._classes_with_config_traits.<locals>.is_any_parent_includedü  s   ø€ ÜÓVÈÏÊÓVÓVÐVrD   c              3  ó@   •K  — | ]  \  }}||xs  ‰|«      f–— Œ y ­wr–   rJ   )rì   rº   Úinc_yesr¥  s      €r:   rî   z:Application._classes_with_config_traits.<locals>.<genexpr>  s-   øè ø€ ð (á$9‘L�C˜ð �gÒ<Ñ!7¸Ó!<Ô=Ù$9ùs   ƒ)rº   r=   r>   re  )rg   r   rq   rÈ   ró   )rU   rg   Úto_incl_origÚclr§  r£  r¥  s        @@r:   r*  z'Application._classes_with_config_traitsä  s¥   ùè ø€ ð  ˆ?Ø—l‘lˆGä#ñ $
à×0Ñ0°Ô9ó$
ó 
ˆõ
	Wð Ø(×-Ñ-Ó/ˆLÜ'ó (à$1×$7Ñ$7Ô$9ó(ó ˆMð  Ò,Øð ð )×.Ñ.Ö0‰KˆB�ÚØ“ñ 1ùs   „BBÂBc                óN  — d| j                   › d�g}|j                  d«       |j                  d«       |j                  d«       |€| j                  n|}t        | j	                  |«      «      }|D ]"  }|j                  |j                  |«      «       Œ$ dj                  |«      S )z/generate default config file from Configurablesz# Configuration file for r†   r%   zc = get_config()  #noqarÅ   )r`   rD  rg   rC  r*  Úclass_config_sectionrÝ   )rU   rg   ÚlinesÚconfig_classesrº   s        r:   Úgenerate_config_filez Application.generate_config_file  s�   € à,¨T¯Y©Y¨K°qÐ9Ð:ˆØ�‰�RÔØ�‰Ð3Ô4Ø�‰�RÔØ") /�$—,’,°wˆÜ˜d×>Ñ>¸wÓGÓHˆÛ!ˆCØ�L‰L˜×1Ñ1°.ÓAÕBð "à�y‰y˜ÓÐrD   c                óÌ   — t        | dd«      rK| j                  j                  D ]*  }t        t        «      5  |j                  «        d d d «       Œ, d| _        y y # 1 sw Y   Œ?xY w)Nr¢   F)r™   r0   rˆ   r   rú   Úcloser¢   )rU   Úhandlers     r:   Úclose_handlerszApplication.close_handlers  sV   € Ü�4Ð.°Ô6ð  Ÿ8™8×,Ô,�ÜœiÕ(Ø—M‘M”O÷ )Ð(ð -ð (-ˆDÕ$ð 7÷
 )Ð(ús   ¶AÁA#	c                óš   — | j                   j                  d| j                  «       | j                  «        t	        j
                  |«       y )NzExiting application: %s)r0   r2   r`   r²  rÌ   r4   )rU   Úexit_statuss     r:   r4   zApplication.exit$  s1   € Ø�‰�‰Ð0°$·)±)Ô<Ø×ÑÔÜ�‰�ÕrD   c                ól   — t        t        «      5  | j                  «        d d d «       y # 1 sw Y   y xY wr–   )r   rú   r²  rÂ   s    r:   Ú__del__zApplication.__del__)  s$   € ô ”iÕ Ø×ÑÔ!÷ !× Ñ ús   �*ª3c                ój   —  | j                   di |¤Ž}|j                  |«       |j                  «        y)z„Launch a global instance of this Application

        If a global instance already exists, this reinitializes and starts it
        NrJ   )r>  r¿   r³   )rº   r$   r7   r5   s       r:   Úlaunch_instancezApplication.launch_instance0  s,   € ð ˆc�l‰lÑ$˜VÑ$ˆØ�‰�tÔØ�	‰	�rD   r–   )rg   úClassesType | Noner>   z+t.Generator[type[Configurable], None, None])r>   r   )r›   r   r>   ÚNone)r>   rº  )r>   Ú	AnyLogger)r7   r=   r>   rº  )r$   ÚArgvTyper>   rº  )r>   út.Generator[str, None, None])rg   re  r>   r½  )F)rg   re  r>   rº  )r>   rX   )r  rX   r$   r¼  r>   rº  )r>   z)tuple[dict[str, t.Any], dict[str, t.Any]])
r$   zlist[str] | Noner¨   r   r«   r   rg   r¹  r>   r   )rY  re  r>   ú	list[str])NF)
r€  rX   rt  ú#str | t.Sequence[str | None] | Noner0   zAnyLogger | Noner�  re  r>   zt.Generator[t.Any, None, None])r>   r¾  )r‡  rX   rt  r¿  r>   rº  )rg   r¹  r>   rX   )r   )r´  zint | str | Noner>   rº  )r$   r¼  r7   r=   r>   rº  )crG   rH   rI   rY   r   r`   Ú__annotations__ra   rb   rc   rd   r   rx  r   rz  re   rg   rq   rr   r   r$   r   r&   r�  r   rZ   r[   Útagr�   rL   rŽ   r�   r�   r“   r   rœ   r    rš   r   r§   r   r”   r¨   rx   r«   r¬   r   rÁ   ro  r   rl  r®   r©   rª   r±   r¶   r¸   r   r¼   rC   r¿   r³   rµ   rß   rÞ   r  r  r  r  r  r  r#  r'  r&  r1  r3  r)  r6  r,  r:  rA  rN  rP  Úclassmethodr[  r^  r¾   r‰  Úpropertyr‹  r’  rœ  r*  r®  r²  r4   r¶  r¸  r\   r]   s   @r:   r<   r<   —   s  ø… ÙBñ -4°MÓ,B€DÐ
)ÓBñ 4;Ð;TÓ3U€KÐ0ÓUá:AÐBTÓ:UÐÐ7ÓUÙ<CÐDXÓ<YÐÐ9ÓYÙ>EÐF\Ó>]ÐÐ;Ó]à!3ÐØ3Ðñ 18³	€HÐ-Ó9ð €Gˆ[Óð -1ð!Ø)ð!à	4ó!ñ. 07°u«~€GÐ,Ó=ñ #'£&€DÐ
Ó(ñ  $Ð$QÓRÐñ ØMØ—l‘lØ2ô÷ 
�c�€cÓð	 ð (ÐáØØgô÷ 
�c�€cÓð ñ
 Ø-Ø*ô÷ 
�c�€cÓð ó
0ñd ˆ]˜L¨+Ð7GÓHò"ó Ið"ñ ˆU˜Ô#ò"ó $ð"ó(ñ ˆUƒ^òó ðñ ð.ô0÷` 
�c�€cÓða ðn $Ð%<Ð=€GˆWÓ=ð Ø §¡ð ðð
 Dð
ð Ø! 4ð ðð
 Kð
ð Ø&¨ð ðð
 Að
ñ#€Eˆ7ó ñ@ 8<³v€KÐ4Ó=áÐ@ÈTÔR€Fñ ‘g“i“€JáØØ
Ø
ðô		€Jñ '+£fÐ˜)Ó,áØPôç	�c�€cÓð ñ ØZôç	�c�€cÓð ñ ÐÓ ò&ó !ð&ñ ˆ]Óò0ó ð0ó

7ñ ˆXÓØô9ó ó ð9ð ó&ó ð&ó'óUóB1ó$óL0óó03óó7óó"ô:ô4ó2Xó2óó/óóð ó%ó ð%ó09ðv	
àð	
ð ð	
ð ð		
ð
 $ð	
ð 
 ó	
ð óó ðð2 òó ðð& ó0,ó ð0,ðd ð
 !%Ø).ð7;àð7;ð 2ð7;ð ð	7;ð
 #'ð7;ð 
(ò7;ó ð7;ðr ò,ó ð,ð àIMð'Øð'Ø#Fð'à	ò'ó ð'ð* ò'ó ð'ð, -1ð(Ø)ð(à	4ó(ôT
 ó-ôó
"ð óó ôrD   r<   c                ó„   — |xs d|› d�}|xs d|› d�}|j                  d«      \  }}||dii}||dii}| ||fd| z   ||fiS )aû  Helper for building basic --trait, --no-trait flags.

    Parameters
    ----------
    name : str
        The name of the flag.
    configurable : str
        The 'Class.trait' string of the trait to be set/unset with the flag
    set_help : unicode
        help string for --name flag
    unset_help : unicode
        help string for --no-name flag

    Returns
    -------
    cfg : dict
        A dict with two keys: 'name', and 'no-name', for setting and unsetting
        the trait, respectively.
    zset z=Truez=Falser†   TFzno-)rõ   )r`   ÚconfigurableÚset_helpÚ
unset_helprº   r   ÚsetterÚunsetters           r:   Úboolean_flagrÊ  C  sw   € ð* Ò5˜T , ¨uÐ5€HØÒ:  l ^°6Ð:€Jà×#Ñ# CÓ(�J€Cˆà�E˜4�=Ð!€FØ�e˜U�^Ð$€HØ�6˜8Ð$ e¨d¡l°X¸zÐ4JÐKÐKrD   c                 óz   — t         j                  «       rt         j                  «       j                  S t	        «       S )z|Get the config object for the global Application instance, if there is one

    otherwise return an empty config object
    )r<   Úinitializedr>  r3   r   rJ   rD   r:   Ú
get_configrÍ  b  s,   € ô
 ×ÑÔ Ü×#Ñ#Ó%×,Ñ,Ð,ä‹xˆrD   Ú__main__)r9   r+   r>   r+   )r%   r%   )
r`   rX   rÅ  rX   rÆ  rX   rÇ  rX   r>   r   )r>   r   )crY   Ú
__future__r   r?   rÊ   rZ   rT  rÓ   rf  rÌ   ÚtypingrA   Úcollectionsr   r   Ú
contextlibr   rÈ   r   Úlogging.configr   Útextwrapr	   Útraitlets.config.configurabler
   r   Útraitlets.config.loaderr   r   r   r   r   r   r   Útraitlets.traitletsr   r   r   r   r   r   r   r   r   r   Útraitlets.utils.bunchr   Útraitlets.utils.nested_updater   Útraitlets.utils.textr   r    Úutilsr"   Úutils.importstringr#   r  rb   rc   Úhasattrr$   rd   rU  r<  Ú_envvarÚlowerr&   ri  Ú
executableÚendswithr‘   ÚTypeVarÚCallableÚAnyr+   ÚUnionÚLoggerr»  rÒ   rX   r   rC  r¼  r�   rf   rC   rú   rF   Ú	FormatterrL   r<   r¨   Údefault_aliasesr«   Údefault_flagsrÊ  rÍ  rG   r¸  rJ   rD   r:   Ú<module>rê     s  ðÙ 2õ #ã Û Û Û 	Û Û 	Û 
Û ß 0Ý Ý Ý %Ý ç M÷÷ ñ ÷÷ ÷ õ (Ý 7ß 8å  Ý ,ð÷
 
�EƒGð ð÷ 
�EƒGð ñ ˆs�FÔØˆt€C„HðÐ ð �*‰*�.‰.ÐHÈ"Ó
M€Ø
‡=�=ƒ?�mÑ#Ø48Ñ1Ø‡]�]ƒ_Ð*Ñ*Ø49Ñ1á
Ø
qÐryÐqzð  {qð  	róð ð
 �^‰^ÒF §¡× 7Ñ 7¸Ó F€
à€A‡I�Iˆc˜Ÿ™ C¨¯© JÑ/Ô0€Ø�G‰G�G—N‘NÐ$BÐBÑC€	Ø
ˆs�A—E‘EˆzÑ
€Ø�‰9�tÑ€Ø�4˜Ñ%Ñ&€óô*	�yô 	ô&�W×&Ñ&ô &ô*aÐ'ô aðP ×%Ñ%€Ø×!Ñ!€ôLó>ð ˆzÒØ×ÑÕ!ð rD   