<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def config_path(path=None, final=False):
 """Return config path."""

    if final and path:
        return path

    if path is None:
        path = default_config_dir()
    try:
        os.makedirs(path)
    except OSError as e:  # pragma: no cover
        if e.errno != errno.EEXIST:
            raise
    return os.path.join(path, 'config.yml')