def get_config(path=os.getcwd()):
config = default<EOL>tries = <NUM_LIT:0><EOL>current_dir = path<EOL>while current_dir and tries < MAX_CONFIG_SEARCH_DEPTH:<EOL><INDENT>potential_path = os.path.join(current_dir, "<STR_LIT>")<EOL>if os.path.exists(potential_path):<EOL><INDENT>with open(potential_path, "<STR_LIT:r>") as f:<EOL><INDENT>config = _merge(config, yaml.safe_load(f))<EOL><DEDENT>logger.debug(f"<STR_LIT>")<EOL>break<EOL><DEDENT>new_dir = os.path.split(current_dir)[<NUM_LIT:0>]<EOL>if current_dir == new_dir:<EOL><INDENT>logger.debug("<STR_LIT>")<EOL>break<EOL><DEDENT>current_dir = new_dir<EOL>tries += <NUM_LIT:1><EOL><DEDENT>return config<EOL>
Search for settings file in root of project and its parents.