def check():
    print("AILab Server Check OK")

def plt_dark():
    import matplotlib.pyplot as plt
    plt.style.use(['dark_background', {'figure.facecolor':'#002b36', 'axes.facecolor':'#002b36'}])

def plt_light():
    import matplotlib.pyplot as plt
    plt.style.use(['seaborn'])
    
def jpl_light():
    from IPython.display import display, HTML
    css = ''
    display(HTML('<style type="text/css">{}</style>Customized changes loaded.'.format(css))) 
    
def jpl_dark():
    from IPython.display import display, HTML
    css = '''/*-----------------------------------------------------------------------------
            | Copyright (c) Jupyter Development Team.
            | Distributed under the terms of the Modified BSD License.
            |----------------------------------------------------------------------------*/

            /*
            The following CSS variables define the main, public API for styling JupyterLab.
            These variables should be used by all plugins wherever possible. In other
            words, plugins should not define custom colors, sizes, etc unless absolutely
            necessary. This enables users to change the visual theme of JupyterLab
            by changing these variables.

            Many variables appear in an ordered sequence (0,1,2,3). These sequences
            are designed to work well together, so for example, `--jp-border-color1` should
            be used with `--jp-layout-color1`. The numbers have the following meanings:

            * 0: super-primary, reserved for special emphasis
            * 1: primary, most important under normal situations
            * 2: secondary, next most important under normal situations
            * 3: tertiary, next most important under normal situations

            Throughout JupyterLab, we are mostly following principles from Google's
            Material Design when selecting colors. We are not, however, following
            all of MD as it is not optimized for dense, information rich UIs.
            */

            :root {

            /* Create the solarized dark palette.
            The bases run in increasing brightness. */

            --solarized-base04: #00242d;
            --solarized-base03: #002b36;
            --solarized-base02: #073642;
            --solarized-base01: #586e75;
            --solarized-base00: #657b83;

            --solarized-base0: #839496;
            --solarized-base1: #93a1a1;
            --solarized-base2: #eee8d5;
            --solarized-base3: #fdf6e3;

            --solarized-orange: #cb4b16;
            --solarized-yellow: #fcc63c;
            --solarized-red: #dc322f;
            --solarized-magenta: #d33682;
            --solarized-violet: #6c71c4;
            --solarized-blue: #46b6fc;
            --solarized-cyan: #2aa198;
            --solarized-green: #859900;


            /* Elevation
            *
            * We style box-shadows using Material Design's idea of elevation. These particular numbers are taken from here:
            *
            * https://github.com/material-components/material-components-web
            * https://material-components-web.appspot.com/elevation.html
            */

            /* The dark theme shadows need a bit of work, but this will probably also require work on the core layout
            * colors used in the theme as well. */
            --jp-shadow-base-lightness: 32;
            --jp-shadow-umbra-color: rgba(
                var(--jp-shadow-base-lightness),
                var(--jp-shadow-base-lightness),
                var(--jp-shadow-base-lightness),
                0.2
            );
            --jp-shadow-penumbra-color: rgba(
                var(--jp-shadow-base-lightness),
                var(--jp-shadow-base-lightness),
                var(--jp-shadow-base-lightness),
                0.14
            );
            --jp-shadow-ambient-color: rgba(
                var(--jp-shadow-base-lightness),
                var(--jp-shadow-base-lightness),
                var(--jp-shadow-base-lightness),
                0.12
            );
            --jp-elevation-z0: none;
            --jp-elevation-z1: 0px 2px 1px -1px var(--jp-shadow-umbra-color),
                0px 1px 1px 0px var(--jp-shadow-penumbra-color),
                0px 1px 3px 0px var(--jp-shadow-ambient-color);
            --jp-elevation-z2: 0px 3px 1px -2px var(--jp-shadow-umbra-color),
                0px 2px 2px 0px var(--jp-shadow-penumbra-color),
                0px 1px 5px 0px var(--jp-shadow-ambient-color);
            --jp-elevation-z4: 0px 2px 4px -1px var(--jp-shadow-umbra-color),
                0px 4px 5px 0px var(--jp-shadow-penumbra-color),
                0px 1px 10px 0px var(--jp-shadow-ambient-color);
            --jp-elevation-z6: 0px 3px 5px -1px var(--jp-shadow-umbra-color),
                0px 6px 10px 0px var(--jp-shadow-penumbra-color),
                0px 1px 18px 0px var(--jp-shadow-ambient-color);
            --jp-elevation-z8: 0px 5px 5px -3px var(--jp-shadow-umbra-color),
                0px 8px 10px 1px var(--jp-shadow-penumbra-color),
                0px 3px 14px 2px var(--jp-shadow-ambient-color);
            --jp-elevation-z12: 0px 7px 8px -4px var(--jp-shadow-umbra-color),
                0px 12px 17px 2px var(--jp-shadow-penumbra-color),
                0px 5px 22px 4px var(--jp-shadow-ambient-color);
            --jp-elevation-z16: 0px 8px 10px -5px var(--jp-shadow-umbra-color),
                0px 16px 24px 2px var(--jp-shadow-penumbra-color),
                0px 6px 30px 5px var(--jp-shadow-ambient-color);
            --jp-elevation-z20: 0px 10px 13px -6px var(--jp-shadow-umbra-color),
                0px 20px 31px 3px var(--jp-shadow-penumbra-color),
                0px 8px 38px 7px var(--jp-shadow-ambient-color);
            --jp-elevation-z24: 0px 11px 15px -7px var(--jp-shadow-umbra-color),
                0px 24px 38px 3px var(--jp-shadow-penumbra-color),
                0px 9px 46px 8px var(--jp-shadow-ambient-color);

            /* Borders
            *
            * The following variables, specify the visual styling of borders in JupyterLab.
            */

            --jp-border-width: 1px;
            --jp-border-color0: rgba(0,0,0,0.2);
            --jp-border-color1: rgba(0,0,0,0.2);
            --jp-border-color2: rgba(0,0,0,0.2);
            --jp-border-color3: rgba(0,0,0,0.2);
            --jp-border-radius: 2px;

            /* UI Fonts
            *
            * The UI font CSS variables are used for the typography all of the JupyterLab
            * user interface elements that are not directly user generated content.
            *
            * The font sizing here is done assuming that the body font size of --jp-ui-font-size1
            * is applied to a parent element. When children elements, such as headings, are sized
            * in em all things will be computed relative to that body size.
            */

            --jp-ui-font-scale-factor: 1.2;
            --jp-ui-font-size0: 0.83333em;
            --jp-ui-font-size1: 13px; /* Base font size */
            --jp-ui-font-size2: 1.2em;
            --jp-ui-font-size3: 1.44em;

            --jp-ui-font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica,
                Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';

            /*
            * Use these font colors against the corresponding main layout colors.
            * In a light theme, these go from dark to light.
            */

            /* Defaults use Material Design specification */
            --jp-ui-font-color0: var(--solarized-base00);
            --jp-ui-font-color1: var(--solarized-base0);
            --jp-ui-font-color1: var(--solarized-base1);
            --jp-ui-font-color3: var(--solarized-base2);

            /*
            * Use these against the brand/accent/warn/error colors.
            * These will typically go from light to darker, in both a dark and light theme.
            */

            --jp-ui-inverse-font-color0: var(--solarized-base01);
            --jp-ui-inverse-font-color1: var(--solarized-base00);
            --jp-ui-inverse-font-color2: var(--solarized-base0);
            --jp-ui-inverse-font-color3: var(--solarized-base1);

            /* Content Fonts
            *
            * Content font variables are used for typography of user generated content.
            *
            * The font sizing here is done assuming that the body font size of --jp-content-font-size1
            * is applied to a parent element. When children elements, such as headings, are sized
            * in em all things will be computed relative to that body size.
            */

            --jp-content-line-height: 1.6;
            --jp-content-font-scale-factor: 1.2;
            --jp-content-font-size0: 0.83333em;
            --jp-content-font-size1: 14px; /* Base font size */
            --jp-content-font-size2: 1.2em;
            --jp-content-font-size3: 1.44em;
            --jp-content-font-size4: 1.728em;
            --jp-content-font-size5: 2.0736em;

            /* This gives a magnification of about 125% in presentation mode over normal. */
            --jp-content-presentation-font-size1: 17px;

            --jp-content-heading-line-height: 1;
            --jp-content-heading-margin-top: 1.2em;
            --jp-content-heading-margin-bottom: 0.8em;
            --jp-content-heading-font-weight: 500;

            /* Defaults use Material Design specification */
            --jp-content-font-color0: var(--solarized-base1);
            --jp-content-font-color1: var(--solarized-base0);
            --jp-content-font-color2: var(--solarized-base00);
            --jp-content-font-color3: var(--solarized-base01);

            --jp-content-link-color: var(--solarized-blue);

            --jp-content-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI',
                Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
                'Segoe UI Symbol';

            /*
            * Code Fonts
            *
            * Code font variables are used for typography of code and other monospaces content.
            */

            --jp-code-font-size: 14px;
            --jp-code-line-height: 1.3077; /* 17px for 13px base */
            --jp-code-padding: 0.385em; /* 5px for 13px base */
            --jp-code-font-family: 'IBM Plex Mono', monospace;

            /* This gives a magnification of about 125% in presentation mode over normal. */
            --jp-code-presentation-font-size: 17px;

            /* Layout
            *
            * The following are the main layout colors use in JupyterLab. In a light
            * theme these would go from light to dark.
            */
            /*
            --jp-layout-color0: var(--solarized-base03);
            --jp-layout-color1: var(--solarized-base02);
            --jp-layout-color2: var(--solarized-base02);
            --jp-layout-color3: var(--solarized-base03);
            --jp-layout-color4: var(--solarized-base00);
                */
                
            --jp-layout-color0: var(--solarized-base04);
            --jp-layout-color1: var(--solarized-base02);
            --jp-layout-color2: var(--solarized-base02);
            --jp-layout-color3: var(--solarized-base03);
            --jp-layout-color4: var(--solarized-base00);

            /* Brand/accent */

            --jp-brand-color0: var(--solarized-blue);
            --jp-brand-color1: var(--solarized-blue);
            --jp-brand-color2: var(--md-blue-300);
            --jp-brand-color3: var(--md-blue-100);

            --jp-accent-color0: var(--solarized-green);
            --jp-accent-color1: var(--solarized-green);
            --jp-accent-color2: var(--md-green-300);
            --jp-accent-color3: var(--md-green-100);

            /* State colors (warn, error, success, info) */

            --jp-warn-color0: var(--solarized-orange);
            --jp-warn-color1: var(--solarized-orange);
            --jp-warn-color2: var(--md-orange-300);
            --jp-warn-color3: var(--md-orange-100);

            --jp-error-color0: var(--solarized-red);
            --jp-error-color1: var(--solarized-red);
            --jp-error-color2: var(--md-red-300);
            --jp-error-color3: var(--md-red-100);

            --jp-success-color0: var(--solarized-green);
            --jp-success-color1: var(--solarized-green);
            --jp-success-color2: var(--md-green-300);
            --jp-success-color3: var(--md-green-100);

            --jp-info-color0: var(--solarized-cyan);
            --jp-info-color1: var(--solarized-cyan);
            --jp-info-color2: var(--md-cyan-300);
            --jp-info-color3: var(--md-cyan-100);

            /* Cell specific styles */

            --jp-cell-padding: 5px;

            --jp-cell-collapser-width: 8px;
            --jp-cell-collapser-min-height: 20px;
            --jp-cell-collapser-not-active-hover-opacity: 0.6;

            --jp-cell-editor-background: var(--jp-layout-color0);
            --jp-cell-editor-border-color: #111; /* base1 */
            --jp-cell-editor-box-shadow: inset 0 0 2px var(--md-blue-300);
            --jp-cell-editor-active-background: var(--jp-layout-color1);
            --jp-cell-editor-active-border-color: #222;

            --jp-cell-prompt-width: 90px;
            --jp-cell-prompt-font-family: 'IBM Plex Mono', monospace;
            --jp-cell-prompt-letter-spacing: 0px;
            --jp-cell-prompt-opacity: 1;
            --jp-cell-prompt-not-active-opacity: 0.5;
            --jp-cell-prompt-not-active-font-color: var(--md-grey-300);
            --jp-cell-inprompt-font-color: var(--md-grey-50);
            --jp-cell-outprompt-font-color: var(--md-grey-50);

            /* Notebook specific styles */

            --jp-notebook-padding: 10px;
            --jp-notebook-scroll-padding: 100px;
            --jp-notebook-select-background: var(--jp-layout-color1);
            --jp-notebook-multiselected-color: rgba(33, 150, 243, 0.24);

            /* Rendermime styles */

            --jp-rendermime-error-background: var(--jp-layout-color0);
            --jp-rendermime-table-row-background: var(--jp-layout-color0);
            --jp-rendermime-table-row-hover-background: rgba(3, 169, 244, 0.2);

            /* Dialog specific styles */

            --jp-dialog-background: rgba(0, 0, 0, 0.6);

            /* Console specific styles */

            --jp-console-padding: 10px;

            /* Toolbar specific styles */

            --jp-toolbar-border-color: var(--jp-layout-color0);
            --jp-toolbar-micro-height: 8px;
            --jp-toolbar-background: var(--jp-layout-color0);
            --jp-toolbar-box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.8);
            --jp-toolbar-header-margin: 4px 4px 0px 4px;
            --jp-toolbar-active-background: var(--jp-layout-color0);

            /* Input field styles */

            --jp-input-box-shadow: inset 0 0 2px rgba(0,0,0,0);
            --jp-input-active-background: var(--jp-layout-color0);
            --jp-input-hover-background: var(--jp-layout-color2);
            --jp-input-background: var(--md-grey-800);
            --jp-input-border-color: var(--jp-border-color1);
            --jp-input-active-border-color: var(--jp-brand-color1);

            /* General editor styles */

            --jp-editor-selected-background: var(--jp-layout-color0);
            --jp-editor-selected-focused-background: rgba(33, 150, 243, 0.24);
            --jp-editor-cursor-color: var(--jp-ui-font-color0);

            /* Code mirror specific styles */

            --jp-mirror-editor-keyword-color: var(--solarized-magenta);
            --jp-mirror-editor-atom-color: var(--solarized-blue);
            --jp-mirror-editor-number-color: var(--solarized-magenta);
            --jp-mirror-editor-def-color: var(--solarized-yellow);
            --jp-mirror-editor-variable-color: var(--solarized-base1);
            --jp-mirror-editor-variable-2-color: var(--solarized-base00);
            --jp-mirror-editor-variable-3-color: var(--solarized-base01);
            --jp-mirror-editor-punctuation-color: var(--solarized-base0);
            --jp-mirror-editor-property-color: var(--solarized-blue);
            --jp-mirror-editor-operator-color: var(--solarized-base2);
            --jp-mirror-editor-comment-color: var(--solarized-base01);
            --jp-mirror-editor-string-color: var(--solarized-yellow);
            --jp-mirror-editor-string-2-color: #f50;
            --jp-mirror-editor-meta-color: #aa22ff;
            --jp-mirror-editor-qualifier-color: #555;
            --jp-mirror-editor-builtin-color: var(--md-green-700);
            --jp-mirror-editor-bracket-color: #997;
            --jp-mirror-editor-tag-color: var(--md-green-700);
            --jp-mirror-editor-attribute-color: var(--md-blue-700);
            --jp-mirror-editor-header-color: var(--md-blue-500);
            --jp-mirror-editor-quote-color: var(--md-green-300);
            --jp-mirror-editor-link-color: var(--md-blue-700);
            --jp-mirror-editor-error-color: #f00;
            --jp-mirror-editor-hr-color: #999;

            /* Vega extension styles */

            --jp-vega-background: var(--md-grey-400);
            }'''

    css = css.replace(';', ' !important;')
    display(HTML('<style type="text/css">{}</style>Customized changes loaded.'.format(css))) 