

def main(in_args):
    port = default_port.get()
    host = 'localhost'
    auto_start = True
    before_args = []
    after_args = None
    i = 1
    while (i < len(in_args)):
        if in_args[i].startswith('--host='):
            host = in_args[i][7:]
            i += 1
            continue
        if in_args[i].startswith('--port='):
            port = in_args[i][7:]
            i += 1
            continue
        if (in_args[i] == '--no_auto_start'):
            auto_start = False
            i += 1
            continue
        if (in_args[i] == 'prelaunch'):
            after_args = in_args[(i + 1):]
            break
        e.append(in_args[i])
        i += 1
    if (after_args == None):
        raise Exception('Expected: prelaunch')
    assert (len(before_args) == 0)
    if (len(after_args) == 0):
        after_args.append('search')
    try:
        sys.stdout.write(run_command_in_existing(host, port, after_args, auto_start))
        return 0
    except Exception as e:
        sys.stdout.write((str(e) + '\n'))
        return (- 1)

dataset/ETHPy150Open natduca/quickopen/src/prelaunch_client.py main/VarMisuse@163/215 `before_args`->`e`