
    oi%                         d dl Zd dlmZmZmZmZmZmZmZm	Z	m
Z
 d dlmZ  G d dej                  j                        Zy)    N)	BoolCallableDictEnumIntListTypeUnicodevalidate)warnc                   L   e Zd ZdZ eg dddd      Z eg dddd      Z edddd	
      Z e	ddd      Z
 eddd      Z edd      Z e	ddd      Z e	ddd      Z e e       dgdd      Z e e       dgdd      Z ed      d        Z e e       dgdd      Z e e       dgdd      Z ed      d        Z ei dd      Z ei dd      Z ed dd!      Z e	ddd"      Z edd#d$d%&      Z edd'd'd(&      Z e e       g d)*      jA                  d      Z! e	ddd+      Z" ed,dd-      Z# ed.ddd/      Z$ ed.ddd0      Z% ed.ddd1      Z& e	ddd2      Z' e(d.ddd34      Z) e(d.ddd54      Z* e	ddd6      Z+ e e       dd7      Z,y.)8VoilaConfigurationzNCommon configuration options between the server extension and the application.)YESNOTEBOOKNOr   z_
    Allow overriding the template (YES), or not (NO), or only from the notebook metadata.
    T)helpconfigz\
    Allow overriding the theme (YES), or not (NO), or only from the notebook metadata.
    labz"template name to be used by voila.)r   
allow_noner   FzFUse the jinja2-based tree page instead of the new JupyterLab-based one)r   r   z
        extra resources used by templates;
        example use with --template=reveal
        --VoilaConfiguration.resources="{'reveal': {'transition': 'fade', 'scroll': True}}"
        )r   r   r   light)r   zXShow left and right margins for the "lab" template, this gives a "classic" template lookz Strip sources from rendered htmlz.*\.(png|jpg|gif|svg)a  
    List of regular expressions for controlling which static files are served.
    All files that are served should at least match 1 allowlist rule, and no denylist rule
    Example: --VoilaConfiguration.file_allowlist="['.*\.(png|jpg|gif|svg)', 'public.*']"
    z Deprecated, use `file_allowlist`file_whitelistc                 0    t        dt        d       |d   S )Nz:Deprecated, use VoilaConfiguration.file_allowlist instead.   
stacklevelvaluer   DeprecationWarningselfproposals     [/home/ubuntu/docker-apps/notebooks/venv/lib/python3.12/site-packages/voila/configuration.py_valid_file_whitelistz(VoilaConfiguration._valid_file_whitelistP   s     H	

       z.*\.(ipynb|py)a  
        List of regular expressions for controlling which static files are forbidden to be served.
        All files that are served should at least match 1 allowlist rule, and no denylist rule
        Example:
        --VoilaConfiguration.file_allowlist="['.*']" # all files
        --VoilaConfiguration.file_denylist="['private.*', '.*\.(ipynb)']" # except files in the private dir and notebook files
    zDeprecated, use `file_denylist`file_blacklistc                 0    t        dt        d       |d   S )Nz9Deprecated, use VoilaConfiguration.file_denylist instead.r   r   r   r   r   s     r"   _valid_file_blacklistz(VoilaConfiguration._valid_file_blacklistm   s     G	

   r$   zMapping of language name to kernel name
        Example mapping python to use xeus-python, and C++11 to use xeus-cling:
        --VoilaConfiguration.extension_language_mapping='{"python": "xpython", "C++11": "xcpp11"}'
        zMapping of file extension to kernel language
        Example mapping .py files to a python language kernel, and .cpp to a C++11 language kernel:
        --VoilaConfiguration.extension_language_mapping='{".py": "python", ".cpp": "C++11"}'
        
   z
    When a cell takes a long time to execute, the http connection can timeout (possibly because of a proxy).
    Voila sends a 'heartbeat' message after the timeout is passed to keep the http connection alive.
    z4Whether to send tracebacks to clients on exceptions.zGjupyter_server.services.kernels.kernelmanager.AsyncMappingKernelManagerz4jupyter_client.multikernelmanager.MultiKernelManagerzThe kernel manager class. This is useful to specify a different kernel manager,
        for example a kernel manager with support for pooling.
        )r   default_valueklassr   z+jupyter_client.kernelspec.KernelSpecManagerzxThe kernel spec manager class.  Allows for setting a custom kernel spec manager for finding and running kernels
        z
    List of HTTP Headers that should be passed as env vars to the kernel.
    Example: --VoilaConfiguration.http_header_envs="['X-CDSDASHBOARDS-JH-USER']"
    )r   z:Flag to enable or disable pre-heat kernel option.
           zbSize of pre-heated kernel pool for each notebook. Zero or negative number means disabled.
        NzThe list of enabled JupyterLab extensions, if `None`, all extensions are loaded.
        This setting has higher priority than the `extension_denylist`
        zPThe list of disabled JupyterLab extensions, if `None`, all extensions are loadedzmThe dictionary of extension configuration, this dict is passed to the frontend
        through the PageConfigzVWhether or not voila should attempt to fix and resolve a notebooks kernelspec metadataa  A function that is called prior to the launch of a new kernel instance
            when a user visits the voila webpage. Used for custom user authorization
            or any other necessary pre-launch functions.

            Should be of the form:

            def hook(req: tornado.web.RequestHandler,
                    notebook: nbformat.NotebookNode,
                    cwd: str)

            Although most customizations can leverage templates, if you need access
            to the request object (e.g. to inspect cookies for authentication),
            or to modify the notebook itself (e.g. to inject some custom structure,
            although much of this can be done by interacting with the kernel
            in javascript) the prelaunch hook lets you do that.
            )r)   r   r   r   a  A function that is called to modify the page config for a given notebook.
            Should be of the form:

            def page_config_hook(
                current_page_config: Dict[str, Any],
                base_url: str,
                settings: Dict[str, Any],
                log: Logger,
                voila_configuration: VoilaConfiguration,
                notebook_path: str
            ) -> Dict[str, Any]:

            The hook receives the default page_config dictionary and all its parameters, it should
            return a dictionary that will be passed to the template as the `page_config` variable
            and the NotebookRenderer. This can be used to pass custom configuration.
            zFlag to enable or disable progressive rendering option.
        This option is not compatible with preheat-kernel option.
        z7Extra paths to look for federated JupyterLab extensions)-__name__
__module____qualname____doc__r   allow_template_overrideallow_theme_overrider
   templater   classic_treer   	resourcesthemeshow_marginsstrip_sourcesr   file_allowlistr   r   r#   file_denylistr%   r'   language_kernel_mappingextension_language_mappingr   http_keep_alive_timeoutshow_tracebacksr	   multi_kernel_manager_classkernel_spec_manager_classtaghttp_header_envspreheat_kerneldefault_pool_sizeextension_allowlistextension_denylistextension_configattempt_fix_notebookr   prelaunch_hookpage_config_hookprogressive_renderingextra_labextensions_path r$   r"   r   r      s   X"!   !  dt3WH VL
 I GD)Ef	L d1STM		!"		N 		!"3	N !  ! 			M 		2	N !  ! #
 "&
" "
 DO "&_D" !%C;	! 	
 
cc  N 	 	 c	 "	  i 	N,  	, !  $	J r$   r   )traitlets.config	traitletsr   r   r   r   r   r   r	   r
   r   warningsr   r   Configurabler   rL   r$   r"   <module>rQ      s0     T T T E))66 Er$   