def parse_path(root_dir):
base_dir, last_dir, position = '<STR_LIT>', '<STR_LIT>', <NUM_LIT:0><EOL>if root_dir:<EOL><INDENT>base_dir, last_dir = os.path.split(root_dir)<EOL>position = -len(last_dir) if last_dir else <NUM_LIT:0><EOL><DEDENT>return base_dir, last_dir, position<EOL>
Split path into head and last component for the completer.
    Also return position where last component starts.
    :param root_dir: str path
    :return: tuple of (string, string, int)