text: """
  This is a simple script to test the Google calendar
  """
  
  from __future__ import print_function
  import datetime
  import pickle
  import os.path
  import sys 
  from googleapiclient.discovery import build
  from google_auth_oauthlib.flow import InstalledAppFlow
  from google.auth.transport.requests import Request
  
  # If modifying these scopes, delete the file token.pickle.
  SCOPES = ['https://www.googleapis.com/auth/calendar.readonly']
  
  def main(email_id):
      """Shows basic usage of the Google Calendar API.
      Prints the start and name of the next 10 events on the user's calendar.
      """
      creds = None
      # The file token.pickle stores the user's access and refresh tokens, and is
      # created automatically when the authorization flow completes for the first
      # time.
      if os.path.exists('token.pickle'):
          with open('token.pickle', 'rb') as token:
              creds = pickle.load(token)
      # If there are no (valid) credentials available, let the user log in.
      if not creds or not creds.valid:
          if creds and creds.expired and creds.refresh_token:
              creds.refresh(Request())
          else:
              print("Your credentials to access Google Calendar are not setup correctly")
      service = build('calendar', 'v3', credentials=creds)
  
      # Call the Calendar API
      now = datetime.datetime.utcnow().isoformat() + 'Z' # 'Z' indicates UTC time
      print('Getting the upcoming 10 events')
      events_result = service.events().list(calendarId=email_id, timeMin=now,
                                          maxResults=10, singleEvents=True,
                                          orderBy='startTime').execute()
      events = events_result.get('items', [])
  
      if not events:
          print('No upcoming events found.')
      for event in events:
          start = event['start'].get('dateTime', event['start'].get('date'))
          print(start, event['summary'])
  
      return events
  
  if __name__ == '__main__':
      if len(sys.argv)>1:
          email_id = sys.argv[1]
          main(email_id)
      else:
          print("USAGE: %s your@domain.com\nEXAMPLE: %s test@qxf2.com\n"%(__file__,__file__))
  
  