def select_dir(window, index=-2, level=0, paths=None,
               func=None, condition_func=None, is_user=False):
    if index == -1:
        return ''

    if level > 0 and index == 0:
        sel_path = paths[0].split('(')[1][:-1]
        if func:
            return_code = func(window, sel_path)
            if return_code == 0:
                return
        else:
            return
    else:
        if index == 1:
            level -= 1
        elif 1 > index:
            level += 1

        if level <= 0:
            level = 0
            dir_path = '.'
            parent_path = '..'
            if is_user:
                paths = pyarduino.base.sys_path.list_user_root_path()
            else:
                paths = pyarduino.base.sys_path.list_os_root_path()
        else:
            sel_path = paths[index]
            if sel_path == pyarduino.base.sys_path.ROOT_PATH:
                sel_path = '/'
            dir_path = os.path.abspath(sel_path)
            if condition_func and condition_func(dir_path):
                func(window, dir_path)
                return
            parent_path = os.path.join(dir_path, '..')

            cur_dir = pyarduino.base.abs_file.Dir(dir_path)
            sub_dirs = cur_dir.list_dirs()
            paths = [d.get_path() for d in sub_dirs]
        paths.insert(0, parent_path)
        paths.insert(0, 'Select current dir (%s)' % dir_path)

    sublime.set_timeout(lambda: window.show_quick_panel(
        paths, lambda index: select_dir(window, index, level, paths,
                                        func, condition_func, is_user)), 5)
dataset/ETHPy150Open Robot-Will/Stino/stino/main.py/select_dir/swapped operands of `>`