

def load_config(domain):
    '\n    Parses and loads up the Galah configuration file and extracts the\n    configuration data for the given domain (ex: "web" or "sheep").\n\n    Global configuration options will always be returned, no matter the domain.\n\n    The configuration file will only be loaded once per instance of the\n    interpreter, so feel free to call this function multiple times in many files\n    to avoid ugly dependency issues.\n\n    '
    global loaded
    first_load = (loaded is None)
    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 = {
        
    }
    user_config = dict(defaults)
    if loaded:
        user_config.update(loaded.config)
    prefix = ('%s/' % domain)
    global_prefix = 'global/'
    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] = k
    return local_config

dataset/ETHPy150Open ucrcsedept/galah/galah/base/config.py load_config/VarMisuse@225/459 `v`->`k`