title: How to use run_flow() in Google Calendar API?
body: <p>I am trying to authenticate to Google Calendar API reusing <a href="https://developers.google.com/google-apps/calendar/get_started" rel="nofollow">the sample described in the docs</a>:</p>
  
  <pre><code>from oauth2client import file
  from oauth2client import client
  from oauth2client import tools
  
  CLIENT_SECRETS = 'client_secrets.json'
  FLOW = client.flow_from_clientsecrets(CLIENT_SECRETS,
                                        scope=[
                                            'https://www.googleapis.com/auth/calendar',
                                            'https://www.googleapis.com/auth/calendar.readonly',
                                        ],
                                        message=tools.message_if_missing(CLIENT_SECRETS))
  
  storage = file.Storage('sample.dat')
  credentials = storage.get()
  if credentials is None or credentials.invalid:
      credentials = tools.run_flow(FLOW, storage, auth_host_name='localhost', auth_host_port=[8080, 8090],
                                   logging_level='ERROR', noauth_local_webserver=False)
  </code></pre>
  
  <p>This code fails with</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/infoscreen/testgoogle.py", line 18, in &lt;module&gt;
      logging_level='ERROR', noauth_local_webserver=False)
    File "C:\infoscreen\oauth2client\util.py", line 132, in positional_wrapper
      return wrapped(*args, **kwargs)
  TypeError: run_flow() got an unexpected keyword argument 'auth_host_name'
  </code></pre>
  
  <p>The <a href="http://google-api-python-client.googlecode.com/hg/docs/epy/oauth2client.tools-module.html#run_flow" rel="nofollow">documentation for <code>run-flow()</code></a> says that </p>
  
  <blockquote>
    <p>It presumes it is run from a command-line application and supports the
    following flags:</p>
    
    <p>--auth_host_name: Host name to use when running a local web server
        to handle redirects during OAuth authorization.
        (default: 'localhost')</p>
  </blockquote>
  
  <p>What is wrong with my code?</p>