code: def _check_token(self):
          
          need_token = (self._token_info is None or
                        self.auth_handler.is_token_expired(self._token_info))
          if need_token:
              new_token = \
                  self.auth_handler.refresh_access_token(
                      self._token_info['refresh_token'])
              # skip when refresh failed
              if new_token is None:
                  return
  
              self._token_info = new_token
              self._auth_header = {"content-type": "application/json",
                                   "Authorization": "Bearer {}".format(
                                       self._token_info.get('access_token'))}
docs: Simple Mercedes me API.