old_contents: import os
  import json
  
  from apiclient import discovery
  import oauth2client
  from oauth2client import client
  from oauth2client import tools
  
  try:
      import argparse
      flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args()
  except ImportError:
      flags = None
  
  SCOPES = 'https://www.googleapis.com/auth/gmail.send'
  
  with open('config.json') as config_file:
      config = json.load(config_file)
  
  def main():
      store = oauth2client.file.Storage(config['credentials_file'])
      credentials = store.get()
      if not credentials or credentials.invalid:
          flow = client.flow_from_clientsecrets(config['client_secret_file'], SCOPES)
          flow.user_agent = 'contact-me'
          if flags:
              credentials = tools.run_flow(flow, store, flags)
          else: # Needed only for compatability with Python 2.6
              credentials = tools.run(flow, store)
          print 'Storing credentials to ' + credential_path
  
  if __name__ == '__main__':
      main()
  
new_contents: import os
  import json
  
  from apiclient import discovery
  import oauth2client
  from oauth2client import client
  from oauth2client import tools
  
  try:
      import argparse
      flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args()
  except ImportError:
      flags = None
  
  SCOPES = 'https://www.googleapis.com/auth/gmail.send'
  
  with open('config.json') as config_file:
      config = json.load(config_file)
  
  def main():
      store = oauth2client.file.Storage(config['credentials_file'])
      credentials = store.get()
      if not credentials or credentials.invalid:
          flow = client.flow_from_clientsecrets(config['client_secret_file'], SCOPES)
          flow.user_agent = 'contact-me'
          if flags:
              credentials = tools.run_flow(flow, store, flags)
          else: # Needed only for compatability with Python 2.6
              credentials = tools.run(flow, store)
          print 'Storing credentials to ' + config['credentials_file']
  
  if __name__ == '__main__':
      main()
  
subject: fix authorize.py error