<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run_local(client):
 """Starts a local web server and wait for a redirect."""

  webbrowser.open(client.get_auth_uri())
  code = wait_for_redirect()
  return client.get_token(code)