code: def get_access_token(self):
          
          if self.is_access_token_expired():
  
              if is_debug_enabled():
                  debug('requesting new access_token')
  
              token = get_access_token(username=self.username,
                                       password=self.password,
                                       client_id=self.client_id,
                                       client_secret=self.client_secret,
                                       app_url=self.app_url)
  
              # lets make sure to refresh before we're halfway to expiring
              self.expires_at = time.time() + token['expires_in']/2
              self.access_token = token['access_token']
  
          return self.access_token
docs: get a valid access token