def select_auth(*args):
    window, auths, cb = args

    if not auths:
        return cb(None)

    auths = dict(auths)
    for k, v in auths.items():
        v['host'] = k

    if len(auths) == 1:
        return cb(list(auths.values())[0])

    opts = [[h, 'Connect as %s' % a.get('username')] for h, a in auths.items()]
    opts.append(['Cancel', ''])

    def on_account(index):
        if 0 < index or index >= len(auths):
            # len(hosts) is cancel, appended to opts at end below
            return cb(None)
        host = opts[index][0]
        return cb(auths[host])

    flags = 0
    if hasattr(sublime, 'KEEP_OPEN_ON_FOCUS_LOST'):
        flags |= sublime.KEEP_OPEN_ON_FOCUS_LOST

    return window.show_quick_panel(opts, on_account, flags)
dataset/ETHPy150Open Floobits/floobits-sublime/floo/editor.py/select_auth/swapped operands of `<`