<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def _start_server(python, port, venv_site_pkgs=None, cwd=None) -> sp.Popen: """ Starts an update server sandboxed in the virtual env, and attempts to read the health endpoint with retries to determine when the server is available. If the number of retries is exceeded, the returned server process will already be terminated. :return: the server process """

    log.info("Starting sandboxed update server on port {}".format(port))
    if venv_site_pkgs:
        python = 'PYTHONPATH={} {}'.format(venv_site_pkgs, python)
    cmd = [python, '-m', 'otupdate', '--debug', '--test', '--port', str(port)]
    log.debug('cmd: {}'.format(' '.join(cmd)))
    proc = sp.Popen(' '.join(cmd), shell=True, cwd=cwd)
    atexit.register(lambda: _stop_server(proc))

    n_retries = 3
    async with aiohttp.ClientSession() as session:
        test_status, detail = await selftest.health_check(
            session=session, port=port, retries=n_retries)
    if test_status == 'failure':
        log.debug(
            "Test server failed to start after {} retries. Stopping.".format(
                n_retries))
        _stop_server(proc)
    return proc