@classmethod<EOL><INDENT>def resolve_prefix_path(cls, start_path=None):<DEDENT>
if not start_path or start_path == '<STR_LIT>':<EOL><INDENT>start_path = os.path.curdir<EOL><DEDENT>cur_path = start_path<EOL>LOGGER.debug('<STR_LIT>', os.path.abspath(cur_path))<EOL>if cls.is_prefix(cur_path):<EOL><INDENT>return os.path.abspath(cur_path)<EOL><DEDENT>cur_path = join(start_path, '<STR_LIT>')<EOL>while not cls.is_prefix(cur_path):<EOL><INDENT>LOGGER.debug('<STR_LIT>', cur_path)<EOL>cur_path = os.path.normpath(<EOL>os.path.join(cur_path, '<STR_LIT:..>', '<STR_LIT:..>', '<STR_LIT>')<EOL>)<EOL>LOGGER.debug('<STR_LIT>', cur_path)<EOL>if os.path.realpath(join(cur_path, '<STR_LIT:..>')) == '<STR_LIT:/>':<EOL><INDENT>raise RuntimeError(<EOL>'<STR_LIT>' %<EOL>os.path.abspath(start_path)<EOL>)<EOL><DEDENT><DEDENT>return os.path.abspath(cur_path)<EOL>
Look for an existing prefix in the given path, in a path/.lago dir, or
in a .lago dir under any of it's parent directories

Args:
    start_path (str): path to start the search from, if None passed, it
        will use the current dir

Returns:
    str: path to the found prefix

Raises:
    RuntimeError: if no prefix was found