def load_config(domain):

    global loaded

    # Note whether this is the first time we're processing the configuraiton. If
    # it is, we'll want to attach the global log handlers.
    first_load = loaded is None

    # Load the configuration if it hasn't been loaded yet. Note this ensures
    # that the configuration is only loaded once per instance of the
    # interpreter
    config_file = os.environ.get("GALAH_CONFIG_PATH",
                                 "/etc/galah/galah.config")
    if not loaded:
        if os.path.isfile(config_file):
            loaded = imp.load_source(
                "user_config_file", config_file
            )

    local_config = {}

    # Note we make a **shallow** copy of the defaults here
    user_config = dict(defaults)

    # If the configuration didn't load correctly, just use the defaults
    if loaded:
        user_config.update(loaded.config)

    # The prefix values we will look for when scanning the configuration file.
    prefix = "%s/" % domain
    global_prefix = "global/"

    # Grab all the configuration values for the given domain, and any global
    # configuration values, then place the rest of the configuration values
    # in there as well.
    for k, v in user_config.items():
        if k.startswith(prefix) and len(k) != len(prefix):
            local_key = k[len(prefix):]

            local_config[local_key] = v
        elif k.startswith(global_prefix) and len(k) != len(global_prefix):
            global_key = k[len(global_prefix):]

            local_config[global_key] = v
        elif "/" in k:
            local_config[k] = v

    return local_config
Return the context to include in the log statement.
dataset/ETHPy150Open ucrcsedept/galah/galah/base/config.py/load_config--crossover with--dataset/ETHPy150Open agoragames/torus/torus/web.py/Web._log_context