<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_config(path=os.getcwd()):
 """Search for settings file in root of project and its parents."""

    config = default
    tries = 0
    current_dir = path
    while current_dir and tries < MAX_CONFIG_SEARCH_DEPTH:
        potential_path = os.path.join(current_dir, ".fonduer-config.yaml")
        if os.path.exists(potential_path):
            with open(potential_path, "r") as f:
                config = _merge(config, yaml.safe_load(f))
            logger.debug(f"Loading Fonduer config from {potential_path}.")
            break

        new_dir = os.path.split(current_dir)[0]
        if current_dir == new_dir:
            logger.debug("Unable to find config file. Using defaults.")
            break
        current_dir = new_dir
        tries += 1

    return config