see default_config for a description of possible config settings
501939
function renderer(parent, config){
    this.parent = ( ( "string" == typeof parent )
		    ? document.getElementById(parent)
		    : parent );
    if (this.parent === undefined) {
        throw "can't find parent element " + parent;
    }
    this.tree = new tree();
    this.node_hidden = {};
    this.children_hidden = {};
    this._sort = "ladderize_up";
    this._layout_dirty = true;
    this._css_prefix = "phylo_tree_" + (id_counter++) + "_";

    var self = this;
    this.node_elem_click_handler = function(event) {
        var node_elem =
            (event.currentTarget) ? event.currentTarget : event.srcElement;
        var node = self.tree.nodes[node_elem.node_id];
        if (node) return self.node_clicked(node, node_elem, event);
    };

    var default_config = {
        // these are in pixels
        // leaf box vertical height, including padding and borders
        box_height: 24,
        // vertical space between leaf boxes
        box_spacing: 10,
        // space between leaf box edge and leaf label
        leaf_padding: 4,
        // leaf border thickness
        leaf_border: 2,
        // leaf left offset
        leaf_margin: 1,
        // width/height of internal nodes
        node_size: 8,

        // leaf border color
        leaf_border_color: "blue",
        // font for leaf labels
        leaf_font: "Helvetica, Arial, sans-serif",
        transition_time: "0.8s"
    };

    this.config = ("object" == typeof config
                   ? bbop.core.merge(default_config, config)
                   : default_config);

    //config settings with default values dependent on other config values
    this.config.parent_padding = ( (this.config.parent_padding === undefined)
                                   ? ((this.config.box_spacing / 2) | 0)
                                   : this.config.parent_padding );

    this.node_style = {
        position: "absolute",
        background: "white",
        "z-index": 2,
        width: this.config.node_size + "px",
        height: this.config.node_size + "px",
        "margin-top": (-this.config.node_size / 2) + "px",
        "margin-left": (-this.config.node_size / 2) + "px",
        border: "1px solid black",
        "transition-property": "top, left",
        "transition-duration": this.config.transition_time,
        "transition-timing-function": "ease-in-out, ease-in-out",
        "box-sizing": "content-box",
        "-moz-box-sizing": "content-box"
    };

    this.leaf_style = {
        position: "absolute",
        background: "#f1f1ff",
        "z-index": 1,
        padding: this.config.leaf_padding + "px",
        // if leaf_padding is too low, the branch line will touch the text
        "padding-left": Math.max(this.config.leaf_padding, 3) + "px",

        // so that the leaves don't cover up the connection lines
        "margin-left": this.config.leaf_margin + "px",

        "margin-top": (-this.config.box_height / 2) + "px",

        // setting font size from box height.  We'd like to set font cap height
        // directly, but we can only set em box size.  Cap height on average is
        // 70% of em box size, so we'll set the font size to the intended
	// height divided by 0.7
        font: ( ( this.config.box_height
                  - ( this.config.leaf_padding * 2 )
                  - ( this.config.leaf_border * 2 ) )
                / 0.7 ) + "px " + this.config.leaf_font,

        // this.config.box_height includes padding and borders, so we
        // subtract those out to set the CSS height, which doesn't include
        // padding or borders
        height: ( this.config.box_height
                  - ( this.config.leaf_padding * 2 )
                  - ( this.config.leaf_border * 2 ) ) + "px",

        // center vertically by setting the line height to 0.7em
        // (corresponding to the way we set font size above)
        "line-height": "0.7em",
        "border-radius": (this.config.leaf_padding + 1) + "px",
        "white-space": "nowrap",
        "transition-property": "top, left",
        "transition-duration": this.config.transition_time,
        "transition-timing-function": "ease-in-out, ease-in-out",
        "box-sizing": "content-box",
        "-moz-box-sizing": "content-box"
    };

    if (this.config.leaf_border > 0) {
        this.leaf_style.border =
            this.config.leaf_border + "px solid "
            + this.config.leaf_border_color;
    }

    this.connection_style = {
        position: "absolute",
        "border-left": "2px solid black",
        "border-top": "2px solid black",
        "border-bottom": "2px solid black",
        "border-right": "none",
        "transition-property": "top, height, left, width, border",
        "transition-duration": this.config.transition_time,
        "transition-timing-function": 
            "ease-in-out, ease-in-out, ease-in-out, ease-in-out, step-start"
    };
}
935275
def read_config():
    """"""
    # XXX modifies global state, which is kind of evil
    config = _load_config()
    if config.get(CFG_IGNORE_DEFAULT_RULES[1], False):
        del IGNORE[:]
    if CFG_IGNORE[1] in config:
        IGNORE.extend(p for p in config[CFG_IGNORE[1]] if p)
    if CFG_IGNORE_BAD_IDEAS[1] in config:
        IGNORE_BAD_IDEAS.extend(p for p in config[CFG_IGNORE_BAD_IDEAS[1]] if p)
915066
def get_default_config(self):
        
        config = super(HttpdCollector, self).get_default_config()
        config.update({
            'path':     'httpd',
            'urls':     ['localhost http://localhost:8080/server-status?auto']
        })
        return config
784416
def _set_default_configs(user_settings, default):
    
    for key in default:
        if key not in user_settings:
            user_settings[key] = default[key]

    return user_settings
437365
def get_default_config(self):
        
        config = super(SlabInfoCollector, self).get_default_config()
        config.update({
            'path':     'slabinfo'
        })
        return config
993995
def discover_settings(conf_base=None):
    
    settings = {
        'zmq_prefix': '',
        'libzmq_extension': False,
        'no_libzmq_extension': False,
        'skip_check_zmq': False,
        'build_ext': {},
        'bdist_egg': {},
    }
    if sys.platform.startswith('win'):
        settings['have_sys_un_h'] = False
    
    if conf_base:
        # lowest priority
        merge(settings, load_config('config', conf_base))
    merge(settings, get_cfg_args())
    merge(settings, get_eargs())
    
    return settings
1194804
def _check_config():
    """"""
    config.CONFIG_DIR.mkdir(parents=True, exist_ok=True)
    verfile = config.CONFIG_DIR / '.version'
    uptodate = verfile.is_file() and verfile.read_text() == __version__
    if not uptodate:
        verfile.write_text(__version__)
    if not (uptodate and config.CONFIG_FILE.is_file()):
        conf.create_config_(update=True)
    for stfile in ('stagpy-paper.mplstyle',
                   'stagpy-slides.mplstyle'):
        stfile_conf = config.CONFIG_DIR / stfile
        if not (uptodate and stfile_conf.is_file()):
            stfile_local = pathlib.Path(__file__).parent / stfile
            shutil.copy(str(stfile_local), str(stfile_conf))
1113462
def _locate_settings(settings=''):
    ""

    import imp
    import sys
    sys.path.append(os.getcwd())
    settings = settings or os.getenv('DJANGO_SETTINGS_MODULE')
    if settings:
        parts = settings.split('.')
        f = imp.find_module(parts[0])[1]
        args = [f] + parts[1:]
        path = os.path.join(*args)
        path = path + '.py'
        if os.path.exists(path):
            return path
932577
def show_configure(self):
        
        logging.info("Displaying configuration window")
        if self.configWindow is None:
            self.configWindow = ConfigWindow(self)
            self.configWindow.show()
        else:
            self.configWindow.deiconify()
586769
def config(name='CACHE_URL', default='locmem://'):
    """"""
    config = {}

    s = env(name, default)

    if s:
        config = parse_cache_url(s)

    return config
182262
def get_default_color_config():
    """"""
    result = ColorConfig(
        pound=DEFAULT_COLOR_POUND,
        heading=DEFAULT_COLOR_HEADING,
        code=DEFAULT_COLOR_CODE,
        backticks=DEFAULT_COLOR_BACKTICKS,
        prompt=DEFAULT_COLOR_PROMPT,
        pound_reset=DEFAULT_COLOR_POUND_RESET,
        heading_reset=DEFAULT_COLOR_HEADING_RESET,
        code_reset=DEFAULT_COLOR_CODE_RESET,
        backticks_reset=DEFAULT_COLOR_BACKTICKS_RESET,
        prompt_reset=DEFAULT_COLOR_PROMPT_RESET
    )
    return result
840316
def _get_tk_config(self, key, default=False):
        
        if default:
            return self._tk_defaults[key]
        else:
            return self.tk[key]
189907
def get_default_config(self):
        
        config = super(NullHandler, self).get_default_config()

        config.update({
        })

        return config
281004
def config_conf(obj):
    ""
    # If we ever want to add some default options this is where to do that
    cfg = {}
    for name in dir(obj):
        if name in CONFIG_PARSER_CFG: # argument of ConfigParser
            cfg[name] = getattr(obj, name)
    return cfg
694461
def _getGuiSettings(self):
        
        # Put the settings into a ConfigObj dict (don't use a config-spec)
        rcFile = self._rcDir+os.sep+APP_NAME.lower()+'.cfg'
        if os.path.exists(rcFile):
            try:
                return configobj.ConfigObj(rcFile)
            except:
                raise RuntimeError('Error parsing: '+os.path.realpath(rcFile))

            # tho, for simple types, unrepr=True eliminates need for .cfgspc
            # also, if we turn unrepr on, we don't need cfgGetBool
        else:
            return {}
957410
def get_default_values(self):
        """"""
        if not self.process_default_values:
            # Old, pre-Optik 1.5 behaviour.
            return optparse.Values(self.defaults)

        # Load the configuration, or error out in case of an error
        try:
            self.config.load()
        except ConfigurationError as err:
            self.exit(UNKNOWN_ERROR, str(err))

        defaults = self._update_defaults(self.defaults.copy())  # ours
        for option in self._get_all_options():
            default = defaults.get(option.dest)
            if isinstance(default, string_types):
                opt_str = option.get_opt_string()
                defaults[option.dest] = option.check_value(opt_str, default)
        return optparse.Values(defaults)
236735
def get_default_config_help(self):
        
        config = super(RiemannHandler, self).get_default_config_help()

        config.update({
            'host': '',
            'port': '',
            'transport': 'tcp or udp',
        })

        return config