Set up a Jupyter notebook with a few defaults.
516274
def setup_Jupyter():
    
    sns.set(context = "paper", font = "monospace")
    warnings.filterwarnings("ignore")
    pd.set_option("display.max_rows",    500)
    pd.set_option("display.max_columns", 500)
    plt.rcParams["figure.figsize"] = (17, 10)
1199676
def setup(interactive, not_relative, dry_run, reset, root_dir, testuser):
    """"""

    click.echo("[cellpy] (setup)")

    # generate variables
    init_filename = create_custom_init_filename()
    userdir, dst_file = get_user_dir_and_dst(init_filename)

    if testuser:
        if not root_dir:
            root_dir = os.getcwd()

        click.echo(f"[cellpy] (setup) DEV-MODE testuser: {testuser}")
        init_filename = create_custom_init_filename(testuser)
        userdir = root_dir
        dst_file = get_dst_file(userdir, init_filename)
        click.echo(f"[cellpy] (setup) DEV-MODE userdir: {userdir}")
        click.echo(f"[cellpy] (setup) DEV-MODE dst_file: {dst_file}")

    if not pathlib.Path(dst_file).is_file():
        reset = True

    if interactive:
        click.echo(" interactive mode ".center(80, "-"))
        _update_paths(root_dir, not not_relative, dry_run=dry_run, reset=reset)
        _write_config_file(
            userdir, dst_file,
            init_filename, dry_run,
        )
        _check()

    else:
        _write_config_file(userdir, dst_file, init_filename, dry_run)
        _check()
1011659
def _setup(self):
        """"""
        default_settings.reload()
        environment_variable = self._kwargs.get(
            "ENVVAR_FOR_DYNACONF", default_settings.ENVVAR_FOR_DYNACONF
        )
        settings_module = os.environ.get(environment_variable)
        self._wrapped = Settings(
            settings_module=settings_module, **self._kwargs
        )
        self.logger.debug("Lazy Settings _setup ...")
89282
def set_default(self):
        """"""
        try:
            os.makedirs(os.path.dirname(self._configfile))
        except:
            pass

        self._config = configparser.RawConfigParser()
        self._config.add_section('Settings')

        for key, val in self.DEFAULTS.items():
            self._config.set('Settings', key, val)

        with open(self._configfile, 'w') as f:
            self._config.write(f)
767813
def setDictDefaults (d, defaults):
  
  for key, val in defaults.items():
    d.setdefault(key, val)

  return d
1341645
def execute_notebook(self, name):
        """"""

        warnings.filterwarnings("ignore", category=DeprecationWarning)
        nb,f = self.load_notebook(name)
        self.run_notebook(nb,f)
        self.assertTrue(True)
956409
def _do_notebook(self, name, convert_notebooks=False):
        """"""
        if convert_notebooks:
            self.convert_and_execute_notebook(name)
        else:
            self.execute_notebook(name)
1021359
def setdefaults(dct, defaults):
    """"""
    for key in defaults:
        dct.setdefault(key, defaults[key])

    return dct
515958
def _setup(self):
        
        settings_module = os.environ.get(ENVIRONMENT_SETTINGS_VARIABLE, 'settings')
        if not settings_module:
            raise ImproperlyConfigured(
                'Requested settings module points to an empty variable. '
                'You must either define the environment variable {0} '
                'or call settings.configure() before accessing the settings.'
                .format(ENVIRONMENT_SETTINGS_VARIABLE))

        self._wrapped = Settings(settings_module, default_settings=global_settings)
975650
def set_defaults(self):
        
        self['mswitch'] = 1
        self['elem'] = '../grid/elem.dat'
        self['elec'] = '../grid/elec.dat'
        self['volt'] = '../mod/volt.dat'
        self['inv_dir'] = '../inv'
        self['diff_inv'] = 'F ! difference inversion?'
        self['iseed_var'] = 'iseed variance'
        self['cells_x'] = '0    ! # cells in x-direction'
        self['cells_z'] = '-1    ! # cells in z-direction'
        self['ani_x'] = '1.000  ! smoothing parameter in x-direction'
        self['ani_z'] = '1.000  ! smoothing parameter in z-direction'
        self['max_it'] = '20    ! max. nr of iterations'
        self['dc_inv'] = 'F     ! DC inversion?'
        self['robust_inv'] = 'T     ! robust inversion?'
        self['fpi_inv'] = 'F     ! final phase improvement?'
        self['mag_rel'] = '5'
        self['mag_abs'] = '1e-3'
        self['pha_a1'] = 0
        self['pha_b'] = 0
        self['pha_rel'] = 0
        self['pha_abs'] = 0
        self['hom_bg'] = 'F'
        self['hom_mag'] = '10.00'
        self['hom_pha'] = '0.00'
        self['another_ds'] = 'F'
        self['d2_5'] = '1'
        self['fic_sink'] = 'F'
        self['fic_sink_node'] = '10000'
        self['boundaries'] = 'F'
        self['boundaries_file'] = 'boundary.dat'
        self['mswitch2'] = '1'
        self['lambda'] = 'lambda'
346640
def setup(app):
    """"""
    app.setup_extension('nbsphinx')
    app.add_source_suffix('.nblink', 'linked_jupyter_notebook')
    app.add_source_parser(LinkedNotebookParser)
    app.add_config_value('nbsphinx_link_target_root', None, rebuild='env')

    return {'version': __version__, 'parallel_read_safe': True}
1179155
def init():
    """"""
    global _default_foreground, _default_background, _default_style
    try:
        attrs = GetConsoleScreenBufferInfo().wAttributes
    except (ArgumentError, WindowsError):
        _default_foreground = GREY
        _default_background = BLACK
        _default_style = NORMAL
    else:
        _default_foreground = attrs & 7
        _default_background = (attrs >> 4) & 7
        _default_style = attrs & BRIGHT
1250985
def set_default(name=None, index=None):
    
    default_was_set = False
    count = 1

    for configuration in _CONFIG.sections():
        if index != None:
            if count == index:
                _CONFIG.set(configuration, 'default', True)
                default_was_set = True
            else:
                _CONFIG.remove_option(configuration, 'default')

        if name != None:
            if configuration == name:
                _CONFIG.set(configuration, 'default', True)
                default_was_set = True
            else:
                _CONFIG.remove_option(configuration, 'default')

        count += 1

    if not default_was_set:
        raise JutException('Unable to find %s configuration' % name)

    with open(_CONFIG_FILEPATH, 'w') as configfile:
        _CONFIG.write(configfile)

    info('Configuration updated at %s' % _JUT_HOME)
592697
def set_default_preferences(self):
        

        LOGGER.debug("> Initializing default settings!")

        for key in self.__default_settings.allKeys():
            self.__settings.setValue(key, self.__default_settings.value(key))

        self.set_default_layouts()
        return True
780834
def set_default_format_options(self, format_options, read=False):
        """"""
        if self.default_notebook_metadata_filter:
            format_options.setdefault('notebook_metadata_filter', self.default_notebook_metadata_filter)
        if self.default_cell_metadata_filter:
            format_options.setdefault('cell_metadata_filter', self.default_cell_metadata_filter)
        if self.comment_magics is not None:
            format_options.setdefault('comment_magics', self.comment_magics)
        if self.split_at_heading:
            format_options.setdefault('split_at_heading', self.split_at_heading)
        if not read and self.default_cell_markers:
            format_options.setdefault('cell_markers', self.default_cell_markers)
        if read and self.sphinx_convert_rst2md:
            format_options.setdefault('rst2md', self.sphinx_convert_rst2md)
731399
def enable_notebook(verbose=0):
    
    libs = ['objexporter.js',
            'ArcballControls.js', 'filesaver.js',
            'base64-arraybuffer.js', 'context.js',
            'chemview.js', 'three.min.js', 'jquery-ui.min.js',
            'context.standalone.css', 'chemview_widget.js',
            'trajectory_controls_widget.js', "layout_widget.js",
            "components/jquery-fullscreen/jquery.fullscreen.js",
            'scales.js']
    fns = [resource_filename('chemview', os.path.join('static', f)) for f in libs]

    [install_nbextension(fn, verbose=verbose, overwrite=True, user=True) for fn in fns]
204716
protected function setDefaults()
  {
    $this->importPaths = array();
    $this->pluginPaths = array();
    $this->sourceMap = self::DEFAULT_SOURCEMAP;
    $this->mapComment = self::DEFAULT_MAPCOMMENT;
    $this->lineNumbers = self::DEFAULT_LINENUMBERS;
    $this->precision = self::DEFAULT_PRECISION;
    $this->style = self::DEFAULT_STYLE;
  }