<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def wait_and_start_browser(host, port=None, cancel_event=None):
 """ Waits for the server to run and then opens the specified address in the browser. Set cancel_event to cancel the wait. """

    if host == '0.0.0.0':
        host = 'localhost'
    if port is None:
        port = 80

    if wait_for_server(host, port, cancel_event):
        start_browser('http://{0}:{1}/'.format(host, port))